improve exception handling
authornupplaPhil <admin@philipp.info>
Fri, 31 Jan 2020 21:25:09 +0000 (22:25 +0100)
committernupplaPhil <admin@philipp.info>
Fri, 31 Jan 2020 21:25:09 +0000 (22:25 +0100)
include/api.php

index b210616..c9402d4 100644 (file)
@@ -5972,9 +5972,9 @@ function api_friendica_notification_seen($type)
                }
                return api_format_data('result', $type, ['result' => "success"]);
        } catch (NotFoundException $e) {
-               throw new BadRequestException('Invalid argument');
+               throw new BadRequestException('Invalid argument', $e);
        } catch (Exception $e) {
-               throw new InternalServerErrorException('Internal Server exception');
+               throw new InternalServerErrorException('Internal Server exception', $e);
        }
 }