valueOrThrow

Extension function to safely get value or throw exception