mirror of
https://github.com/dwaxweiler/connector-mobilizon
synced 2025-06-05 21:59:25 +02:00
return status code in error cases too
This commit is contained in:
@ -44,9 +44,9 @@ class Api {
|
||||
}
|
||||
return $events;
|
||||
} catch (GeneralException $e) {
|
||||
return 'The events could not be loaded!';
|
||||
return new \WP_Error('events_not_loading', 'The events could not be loaded!', array('status' => 500));
|
||||
} catch (GroupNotFoundException $e) {
|
||||
return sprintf('The group "%s" could not be found!', $groupName);
|
||||
return new \WP_Error('group_not_found', sprintf('The group "%s" could not be found!', $groupName), array('status' => 404));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user