mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-02 20:37:08 +01:00
Improve VALIDATE error handling.
This commit is contained in:
4
dist/cli/error.js
vendored
4
dist/cli/error.js
vendored
@ -230,6 +230,10 @@ Error-handling routines for HackMyResume.
|
||||
case HMSTATUS.createError:
|
||||
msg = printf(M2C(this.msgs.createError.msg), ex.inner.path);
|
||||
etype = 'error';
|
||||
break;
|
||||
case HMSTATUS.validateError:
|
||||
msg = printf(M2C(this.msgs.validateError.msg), ex.inner.toString());
|
||||
etype = 'error';
|
||||
}
|
||||
return {
|
||||
msg: msg,
|
||||
|
4
dist/cli/msg.yml
vendored
4
dist/cli/msg.yml
vendored
@ -44,7 +44,7 @@ events:
|
||||
- "INVALID"
|
||||
- "BROKEN"
|
||||
- "MISSING"
|
||||
- "UNKNOWN"
|
||||
- "ERROR"
|
||||
beforePeek:
|
||||
msg:
|
||||
- Peeking at **%s** in **%s**
|
||||
@ -107,3 +107,5 @@ errors:
|
||||
msg: Failed to create **'%s'**.
|
||||
exiting:
|
||||
msg: Exiting with status code **%s**.
|
||||
validateError:
|
||||
msg: "An error occurred during validation:\n%s"
|
||||
|
6
dist/cli/out.js
vendored
6
dist/cli/out.js
vendored
@ -151,8 +151,12 @@ Output routines for HackMyResume.
|
||||
case 'missing':
|
||||
style = 'red';
|
||||
adj = msgs[4];
|
||||
break;
|
||||
case 'unknown':
|
||||
style = 'red';
|
||||
adj = msgs[5];
|
||||
}
|
||||
evt.schema = evt.schema.toUpperCase();
|
||||
evt.schema = evt.schema.replace('jars', 'JSON Resume').toUpperCase();
|
||||
L(M2C(msgs[0], 'white') + chalk[style].bold(adj), evt.file, evt.schema);
|
||||
if (evt.violations) {
|
||||
_.each(evt.violations, function(err, idx) {
|
||||
|
Reference in New Issue
Block a user