Tell the user the filesize-limit if the screenshot is too big.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
tastytea 2020-10-27 14:23:03 +01:00
parent 85a191c74d
commit aeeb06367e
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07

View File

@ -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()};