2020-10-27 11:27:17 +01:00
|
|
|
'use strict';
|
|
|
|
|
2021-10-20 17:30:05 +02:00
|
|
|
const { ApplicationError } = require('@strapi/utils').errors;
|
2020-09-29 12:00:25 +02:00
|
|
|
|
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';
|
|
|
|
}
|
|
|
|
}
|
2020-09-29 12:00:25 +02:00
|
|
|
|
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';
|
2020-09-29 12:00:25 +02:00
|
|
|
}
|
2021-10-20 17:30:05 +02:00
|
|
|
}
|
2020-09-29 12:00:25 +02:00
|
|
|
|
|
|
|
module.exports = {
|
2021-10-20 17:30:05 +02:00
|
|
|
FileTooLargeError,
|
|
|
|
FileNotFoundError,
|
2020-09-29 12:00:25 +02:00
|
|
|
};
|