25 lines
578 B
JavaScript
Raw Normal View History

'use strict';
2021-10-20 17:30:05 +02:00
const { ApplicationError } = require('@strapi/utils').errors;
2021-10-20 17:30:05 +02:00
class FileTooLargeError extends ApplicationError {
constructor(message, details) {
super(message, details);
this.name = 'FileTooLargeError';
this.message = message || 'The file is bigger than the limit size';
}
}
2021-10-20 17:30:05 +02:00
class FileNotFoundError extends ApplicationError {
constructor(message, details) {
super(message, details);
this.name = 'FileNotFoundError';
this.message = message || 'File not found';
}
2021-10-20 17:30:05 +02:00
}
module.exports = {
2021-10-20 17:30:05 +02:00
FileTooLargeError,
FileNotFoundError,
};