by nodesocket · 12y ago · 0 comments
if [ $? != 0 ]; then
echo "{\"error\": \"Failed to connect to the database.\"}" >&2;
exit 1;
fi if ! command_that_may_error; then
echo "{\"error\": \"Failed to connect to the database.\"}" >&2;
exit 1;
fi