Skip to content

Instantly share code, notes, and snippets.

@jastisriradheshyam
Created August 19, 2019 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jastisriradheshyam/54cbdd2f698281470148560b6a091333 to your computer and use it in GitHub Desktop.
Save jastisriradheshyam/54cbdd2f698281470148560b6a091333 to your computer and use it in GitHub Desktop.
Error handling Javascript
// response for error handling
let response = {
success: Boolean,
errorType: Number, // 1 - Programmer or config, 2 - Operational
responseCode: String,
message: String
};
@jastisriradheshyam
Copy link
Author

Defining errorType is difficult

2 is for error caused by the inputs to the system which are not valid and has to be corrected according to current state of the system.
1 is the programmer or system error which is not due to the correct inputs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment