mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-07-01 16:01:07 +01:00
Adjust error handling / tests.
This commit is contained in:
@ -157,8 +157,14 @@ initialize = ( ar, exitCallback ) ->
|
||||
|
||||
# Override the .missingArgument behavior
|
||||
Command.prototype.missingArgument = (name) ->
|
||||
if this.name() != 'new'
|
||||
throw { fluenterror: HMSTATUS.resumeNotFound, quit: true }
|
||||
_err.err
|
||||
fluenterror:
|
||||
if this.name() != 'new'
|
||||
then HMSTATUS.resumeNotFound
|
||||
else HMSTATUS.createNameMissing
|
||||
, true
|
||||
return
|
||||
|
||||
|
||||
# Override the .helpInformation behavior
|
||||
Command.prototype.helpInformation = ->
|
||||
|
@ -39,7 +39,7 @@ _create = ( src, dst, opts ) ->
|
||||
, @
|
||||
|
||||
if @hasError() and !opts.assert
|
||||
@reject results
|
||||
@reject @errorCode
|
||||
else if !@hasError()
|
||||
@resolve results
|
||||
results
|
||||
|
@ -43,7 +43,6 @@ _validate = (sources, unused, opts) ->
|
||||
return { } if @hasError() and opts.assert
|
||||
r = _validateOne.call @, t, validator, schemas
|
||||
if r.fluenterror
|
||||
console.log r
|
||||
r.quit = opts.assert
|
||||
@err r.fluenterror, r
|
||||
r
|
||||
|
@ -64,7 +64,8 @@ Verb = module.exports = Class.extend
|
||||
payload.throw = hot
|
||||
@setError errorCode, payload
|
||||
if payload.quit
|
||||
@reject payload
|
||||
console.log payload
|
||||
@reject errorCode
|
||||
@fire 'error', payload
|
||||
if hot
|
||||
throw payload
|
||||
|
Reference in New Issue
Block a user