1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

better upload error handling

This commit is contained in:
Robin Appelman 2017-06-02 23:20:44 +02:00
commit af6be81db6
3 changed files with 28 additions and 8 deletions

View file

@ -18,6 +18,13 @@ class UploadController extends BaseController {
$demo = $this->file('demo');
$demoFile = $demo['tmp_name'];
echo $this->uploadProvider->upload($key, $red, $blu, $name, $demoFile);
try {
echo $this->uploadProvider->upload($key, $red, $blu, $name, $demoFile);
} catch (\Exception $e) {
\Flight::response()
->status(500)
->write($e->getMessage())
->send();
}
}
}