mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 20:40:15 +02:00
Use skip/take cursors instead of page number
This commit is contained in:
@@ -14,7 +14,11 @@ export const errorHandler = (
|
||||
});
|
||||
|
||||
if (err.message) {
|
||||
message = isJsonString(err.message) ? JSON.parse(err.message) : err.message;
|
||||
message = isJsonString(err.message)
|
||||
? Array.isArray(JSON.parse(err.message))
|
||||
? JSON.parse(err.message)[0].message // Handles errors sent from zod preprocess
|
||||
: JSON.parse(err.message)
|
||||
: err.message;
|
||||
}
|
||||
|
||||
res.status(err.statusCode || 500).json({
|
||||
|
||||
Reference in New Issue
Block a user