Edit UI sends editComment mutation, handles errors

This commit is contained in:
Benjamin Goering
2017-05-02 22:07:23 -05:00
parent aa18a433f8
commit b9a3466e2e
10 changed files with 95 additions and 10 deletions
+4 -1
View File
@@ -251,7 +251,10 @@ const editComment = async ({user, loaders: {Comments}}, {id, edit}) => {
} catch (error) {
switch (error.name) {
case 'EditWindowExpired':
throw errors.ErrNotAuthorized;
throw new errors.APIError('You can no longer edit this comment. The window to do so has expired.', {
status: 401,
translation_key: 'error.editWindowExpired',
});
default:
throw error;
}