Skip to content

Commit

Permalink
chore: set max file informational error message
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Aug 30, 2022
1 parent 80a11d4 commit 69440ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/default.cjs
Expand Up @@ -68,6 +68,7 @@ const config = {
},
settings: {
enableFileUpload: JSON.parse(SECRET_ENABLE_FILE_UPLOAD),
fileLimit: SECRET_FILE_LIMIT,
},
},
};
Expand Down
2 changes: 2 additions & 0 deletions src/client/routes/home/index.js
Expand Up @@ -162,6 +162,8 @@ const Home = () => {
if (json.statusCode !== 201) {
if (json.message === 'request file too large, please check multipart config') {
setError('The file size is too large');
} else if (json.message === 'reach files limit') {
setError(`Max ${config.get('settings.fileLimit', 3)} files allowed`);
} else {
setError(json.error);
}
Expand Down

0 comments on commit 69440ef

Please sign in to comment.