Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/handlers/helpers.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function error(error, req, res, _next) {
}


return res.status(statusCode).json({ error: message });
return res.status(statusCode).json({ error: message, data: error.data });
};


Expand Down Expand Up @@ -140,4 +140,4 @@ module.exports = {
parseQuery,
rateLimit,
verify,
}
}
4 changes: 2 additions & 2 deletions server/handlers/links.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ async function create(req, res) {
if (tasks[1]) {
const error = "Custom URL is already in use.";
res.locals.errors = { customurl: error };
throw new CustomError(error);
throw new CustomError(error, 409, utils.sanitize.link(tasks[1]));
}

// Create new link
Expand Down Expand Up @@ -659,4 +659,4 @@ module.exports = {
redirect,
redirectProtected,
redirectCustomDomainHomepage,
}
}