aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorPitu <[email protected]>2019-03-12 05:38:13 +0000
committerPitu <[email protected]>2019-03-12 05:38:13 +0000
commitdd98cecfebff9f98383d604b9a20fa8a8f32380a (patch)
treed38f172644ddf6d0beeaa0981d59a90926ed5667 /src/api
parentTypo (diff)
downloadhost.fuwn.me-dd98cecfebff9f98383d604b9a20fa8a8f32380a.tar.xz
host.fuwn.me-dd98cecfebff9f98383d604b9a20fa8a8f32380a.zip
Error consistency
Diffstat (limited to 'src/api')
-rw-r--r--src/api/routes/albums/albumDELETE.js3
-rw-r--r--src/api/routes/albums/link/linkDELETE.js1
-rw-r--r--src/api/routes/albums/link/linkEditPOST.js3
-rw-r--r--src/api/routes/albums/link/linkPOST.js3
4 files changed, 3 insertions, 7 deletions
diff --git a/src/api/routes/albums/albumDELETE.js b/src/api/routes/albums/albumDELETE.js
index 3fdf209..23dcf40 100644
--- a/src/api/routes/albums/albumDELETE.js
+++ b/src/api/routes/albums/albumDELETE.js
@@ -30,8 +30,7 @@ class albumDELETE extends Route {
await db.table('albums').where({ id }).delete();
return res.json({ message: 'The album was deleted successfully' });
} catch (error) {
- log.error(error);
- return res.json({ message: 'There was a problem deleting the album' });
+ return super.error(res, error);
}
}
}
diff --git a/src/api/routes/albums/link/linkDELETE.js b/src/api/routes/albums/link/linkDELETE.js
index 4f948ba..d6d98c4 100644
--- a/src/api/routes/albums/link/linkDELETE.js
+++ b/src/api/routes/albums/link/linkDELETE.js
@@ -23,7 +23,6 @@ class linkDELETE extends Route {
.where({ linkId: link.id })
.delete();
} catch (error) {
- console.log(error);
return super.error(res, error);
}
diff --git a/src/api/routes/albums/link/linkEditPOST.js b/src/api/routes/albums/link/linkEditPOST.js
index 0586f08..6776b73 100644
--- a/src/api/routes/albums/link/linkEditPOST.js
+++ b/src/api/routes/albums/link/linkEditPOST.js
@@ -26,8 +26,7 @@ class linkEditPOST extends Route {
});
return res.json({ message: 'Editing the link was successful' });
} catch (error) {
- log.error(error);
- return res.json({ message: 'There was a problem editing the link' });
+ return super.error(res, error);
}
}
}
diff --git a/src/api/routes/albums/link/linkPOST.js b/src/api/routes/albums/link/linkPOST.js
index e929c89..297348c 100644
--- a/src/api/routes/albums/link/linkPOST.js
+++ b/src/api/routes/albums/link/linkPOST.js
@@ -46,8 +46,7 @@ class linkPOST extends Route {
identifier
});
} catch (error) {
- log.error(error);
- return res.status(500).json({ message: 'There was a problem creating the link' });
+ return super.error(res, error);
}
}
}