Return proper status code when encountering an error

This commit is contained in:
artisticMink 2023-10-26 19:48:42 +02:00
parent 22a2a40072
commit 9eda65d089

View File

@ -1199,7 +1199,7 @@ app.post("/v2/editcharacterattribute", jsonParser, async function (request, resp
response.status(400).send({message: `Validation failed for card ${character.name}`, field: validator.getValidationError});
}
} catch (exception) {
response.status(400).send({message: 'Unexpected error while saving character.', error: exception.toString()});
response.status(500).send({message: 'Unexpected error while saving character.', error: exception.toString()});
}
});