featherbone-shipengine
Version:
Forked and patched version of the official ShipEngine JavaScript SDK for Node.js
27 lines • 930 B
JavaScript
import { ShipEngineError } from "./shipengine-error";
/**
* This error occurs when a field has been set to an invalid value.
*/
export class InvalidFieldValueError extends ShipEngineError {
constructor(...args) {
let requestID, source, fieldName, reason, fieldValue;
// Determine which overload was called
if (args.length >= 4) {
requestID = args[0];
source = args[1];
fieldName = args[2];
reason = args[3];
fieldValue = args[4];
}
else {
source = "shipengine";
fieldName = args[0];
reason = args[1];
fieldValue = args[2];
}
super(requestID, source, "validation", "invalid_field_value", `${fieldName || "Field"} ${reason}`);
this.fieldName = fieldName;
this.fieldValue = fieldValue;
}
}
//# sourceMappingURL=invalid-field-value-error.js.map