Show error message when API request fails
It would be great to catch OCSException
/ HintException
and instead of returning an empty 200 response return a "400 Bad request" response with details about what failed exactly.
Use case: We need to prevent user deletion under certain conditions and have installed a \OC\User preDelete
hook which throws an exception if a user shouldn't be able to delete his account. Without a proper error message, the page just reloads and the user is confused about why he can't delete his account.