Fixed handling of unknown door types
This commit is contained in:
parent
9bb8277583
commit
04392e387d
|
@ -158,6 +158,11 @@ exports.getModule = class AbracadabraModule extends MenuModule {
|
|||
fileType: self.config.dropFileType,
|
||||
});
|
||||
|
||||
if(!(self.dropFile.isSupported())) {
|
||||
// Return error so complete will log and return
|
||||
return callback(Errors.AccessDenied('Dropfile format not supported'));
|
||||
}
|
||||
|
||||
return self.dropFile.createFile(callback);
|
||||
},
|
||||
],
|
||||
|
|
|
@ -91,19 +91,21 @@ module.exports = class DropFile {
|
|||
return undefined;
|
||||
}
|
||||
const filePath = paths.join(this.dropFileFormatDirectory, fileName);
|
||||
fs.access(filePath, fs.constants.R_OK, err => {
|
||||
if (err) {
|
||||
Log.info({filename: fileName}, 'Dropfile format not found.');
|
||||
if(!fs.existsSync(filePath)) {
|
||||
Log.info({filename: fileName}, 'Dropfile format not found or readable.');
|
||||
return undefined;
|
||||
}
|
||||
});
|
||||
|
||||
// Return the handler to get the dropfile, because in the future we may have additional handlers
|
||||
return this.getDropfile;
|
||||
}
|
||||
|
||||
getContents() {
|
||||
const handler = this.getHandler().bind(this);
|
||||
const handlerRef = this.getHandler();
|
||||
if(!handlerRef) {
|
||||
return undefined;
|
||||
}
|
||||
const handler = handlerRef.bind(this);
|
||||
const contents = handler();
|
||||
return contents;
|
||||
}
|
||||
|
|
|
@ -8,17 +8,17 @@ NOTPROVIDED
|
|||
{UI}
|
||||
0
|
||||
{CT}
|
||||
{CT} {DT}
|
||||
{CT} {getCurrentDateMMDDYY}
|
||||
{MC}
|
||||
{DN}
|
||||
999
|
||||
0
|
||||
999999
|
||||
555-555-5555
|
||||
{DT} {CT}
|
||||
{getCurrentDateMMDDYY} {CT}
|
||||
NOVICE
|
||||
All
|
||||
{DT}
|
||||
{getCurrentDateMMDDYY}
|
||||
{UC}
|
||||
{SH}
|
||||
0
|
||||
|
@ -31,6 +31,6 @@ REMOTE
|
|||
38400
|
||||
FALSE
|
||||
Normal Connection
|
||||
{DT} {CT}
|
||||
{getCurrentDateMMDDYY} {CT}
|
||||
{ND}
|
||||
0
|
Loading…
Reference in New Issue