mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-10 07:47:07 +01:00
Improve VALIDATE error handling.
This commit is contained in:
@ -222,6 +222,10 @@ assembleError = ( ex ) ->
|
||||
msg = printf M2C( this.msgs.createError.msg ), ex.inner.path
|
||||
etype = 'error'
|
||||
|
||||
when HMSTATUS.validateError
|
||||
msg = printf M2C( @msgs.validateError.msg ), ex.inner.toString()
|
||||
etype = 'error'
|
||||
|
||||
msg: msg # The error message to display
|
||||
withStack: withStack # Whether to include the stack
|
||||
quit: quit
|
||||
|
@ -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"
|
||||
|
@ -148,7 +148,8 @@ module.exports = class OutputHandler
|
||||
when 'invalid' then style = 'yellow'; adj = msgs[2]
|
||||
when 'broken' then style = 'red'; adj = msgs[3]
|
||||
when 'missing' then style = 'red'; adj = msgs[4]
|
||||
evt.schema = evt.schema.toUpperCase()
|
||||
when 'unknown' then style = 'red'; adj = msgs[5]
|
||||
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
|
||||
|
Reference in New Issue
Block a user