Tell the user the filesize-limit if the screenshot is too big.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
85a191c74d
commit
aeeb06367e
|
@ -71,7 +71,8 @@ entry_type parse_formdata()
|
|||
constexpr size_t size_limit{1024 * 1024 * 2}; // 2 MiB.
|
||||
if (screenshot->getDataLength() > size_limit)
|
||||
{
|
||||
throw runtime_error{"Filesize too big"};
|
||||
throw runtime_error{"The screenshot is too big. "
|
||||
"The limit is 2 MiB."};
|
||||
}
|
||||
|
||||
const string filepath{files::get_tmpdir() / screenshot->getFilename()};
|
||||
|
|
Reference in New Issue
Block a user