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:
parent
9b1c5e83ff
commit
af6be81db6
3 changed files with 28 additions and 8 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue