Add unpack state, command not found errors
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
const { Injectable } = require('flitter-di')
|
||||
const ImplementationError = require('libflitter/errors/ImplementationError')
|
||||
const PermissionDeniedError = require('../logical/error/PermissionDeniedError')
|
||||
const CommandNotFoundError = require('../logical/error/CommandNotFoundError')
|
||||
const uuid = require('uuid/v4')
|
||||
const UniversalPath = require('../logical/UniversalPath')
|
||||
const SystemMetrics = require('../logical/SystemMetrics')
|
||||
@@ -213,10 +214,18 @@ class Host extends Injectable {
|
||||
'permission denied'
|
||||
]
|
||||
|
||||
const not_found_phrases = [
|
||||
'command not found',
|
||||
]
|
||||
|
||||
for ( const phrase of access_denied_phrases ) {
|
||||
if ( both.includes(phrase) ) return PermissionDeniedError
|
||||
}
|
||||
|
||||
for ( const phrase of not_found_phrases ) {
|
||||
if ( both.includes(phrase) ) return CommandNotFoundError
|
||||
}
|
||||
|
||||
return Error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user