FreedomBen / libmalan

Simple TypeScript utility methods for accessing the Malan authentication service
MIT License
0 stars 1 forks source link

include validation errors in MalanError #26

Closed cainlevy closed 2 years ago

cainlevy commented 2 years ago

Fixes MalanError to include the errors key mentioned in the 422 message:

The request was syntactically correct, but some or all of the parameters failed validation. See errors key for details

Copying an object into a class is a little annoying, but it seems worthwhile for the easy affordance of instanceof checks when application developers need to detect and handle specific cases such as duplicate usernames.