AutoCatBackend/models/DebugInfo.js

32 lines
445 B
JavaScript

class DebugInfo {
status
fields
error
constructor() {
this.status = 0;
this.fields = 0;
this.error = null;
}
static fromError(error) {
let di = new DebugInfo();
di.status = 1;
di.error = error;
return di;
}
static fromWarning(warning) {
let di = new DebugInfo();
di.status = 2;
di.error = warning;
return di;
}
setWarning(warning) {
this.status = 2;
this.error = warning;
}
}
module.exports = DebugInfo;