generated from FullstackAcademy/Fitness-tracker-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patherrors.js
14 lines (14 loc) · 760 Bytes
/
errors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module.exports = {
ActivityExistsError: (name) => `An activity with name ${name} already exists`,
ActivityNotFoundError: (id) => `Activity ${id} not found`,
UnauthorizedError: () => "You must be logged in to perform this action",
UnauthorizedUpdateError: (username, name) =>
`User ${username} is not allowed to update ${name}`,
UnauthorizedDeleteError: (username, name) =>
`User ${username} is not allowed to delete ${name}`,
DuplicateRoutineActivityError: (routineId, activityId) =>
`Activity ID ${activityId} already exists in Routine ID ${routineId}`,
UserDoesNotExistError: (name) => `User ${name} does not exist`,
PasswordTooShortError: () => `Password Too Short!`,
UserTakenError: name => `User ${name} is already taken.`
}