Matter In Motion. Error Codes
Common errors for Matter in Motion protocol
Errors codes:
- 4000 Call — general error to return
- 4100 Unauthorized — unauthorized
- 4104 ProviderNotFound — Auth provider not found
- 4110 Forbidden — forbidden
- 4120 NotValidToken — token not valid or expired
- 4200 RequestValidation — request validation failed
- 4210 ResponseValidation — response validation failed
- 4220 RequestTooLarge — request entity too large
- 4230 RequestEncode — request encode error
- 4235 RequestDecode — request decode error
- 4240 ResponseEncode — response encode error
- 4245 ResponseDecode — response decode error
- 4250 UnsupportedMedia — unsupported media
- 4255 NoFilesInRequest — no files found in request
- 4400 MethodNotFound — method not found
- 4500 Duplicate — duplicate entity
- 4540 NotFound — not found
- 5000 ServerError — server error
- 5100 NetworkError — network error
Usage
const errors = ;//when you need to return an error:return errors;//orthrow errors;
return error;//orthrow error;
You can add any data and/or message to errors;
Custom errors
const errors = ;const CustomError = errors; //and then you can use itreturn ;//orthrow ;
- code — error code
- message — default message
- toString — optional toString function
License: MIT