@athenna/database
Version:
The Athenna database handler for SQL/NoSQL.
26 lines (25 loc) • 835 B
JavaScript
/**
* @athenna/database
*
* (c) João Lenon <lenon@athenna.io>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { Exception } from '@athenna/common';
export class NullableValueException extends Exception {
constructor(records) {
if (records.length > 1) {
records = records.join(', ');
}
else {
records = records[0];
}
super({
status: 400,
code: 'E_NULLABLE_VALUE_ERROR',
message: `The properties [${records}] are undefined or null.`,
help: `Your properties [${records}] has the option isNullable set to true in it's model. Try setting values to these properties or set the isNullable property to false.`
});
}
}