ionic-appauth icon indicating copy to clipboard operation
ionic-appauth copied to clipboard

Use constants instead of raw text for errors

Open sneko opened this issue 3 years ago • 1 comments

Hi @wi3land ,

Depending on the returned error from your library I need to go through a switch, and for now all errors are harcoded as text which is difficult to believe they won't change in the future.

Examples: https://github.com/wi3land/ionic-appauth/blob/3c4c5e900ffc3549090333bd53fbff643473afc2/src/authorization-request-handler.ts#L57 https://github.com/wi3land/ionic-appauth/blob/3c4c5e900ffc3549090333bd53fbff643473afc2/src/authorization-request-handler.ts#L68 ...

It would be great if you could provide constants like const ERROR_HANDLE_NOT_AVAILABLE = "Handle Not Available", like that you could change text if needed without breaking things in the developer code conditions :)

Thanks

sneko avatar Jul 28 '21 13:07 sneko

I will look to introduce this in the next release, thanks

wi3land avatar Aug 06 '21 09:08 wi3land