-
-
Save dornatsky/3945458 to your computer and use it in GitHub Desktop.
Errors formats.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Single error. | |
{ | |
error: "a is bad" | |
} | |
// Single detailed error. | |
{ | |
error: { | |
message : 'a is bad', | |
text : 'a is bad because of ...', | |
code : ' > error in line ....' | |
} | |
} | |
// Multiple errors. | |
{ | |
errors: [ | |
"a is bad", | |
"b is bad" | |
] | |
} | |
// Multiple detailed errors. | |
{ | |
errors: [ | |
{ | |
message : 'a is bad', | |
code : ' > error in line ....' | |
}, | |
{ | |
message : 'b is bad', | |
code : ' > error in line ....' | |
} | |
] | |
} | |
// Detailed message. | |
// All attributes are optional. | |
{ | |
// Simple text message. | |
message : 'b is bad', | |
// Detailed textual description. | |
text : 'b is bad because of ...', | |
// Code snipped. | |
code : ' > error in line ....' | |
// May be more in future ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
{
errors: [
"a is bad",
"b is bad"
],
isPreformatted: true
}