4 ms·
Just do it all in the condition instead of separately: if ! command_that_may_error; then echo "{\"error\": \"Failed to connect to the database.\"}"
by matt_kantor 12y ago
Just do it all in the condition instead of separately:
if ! command_that_may_error; then
echo "{\"error\": \"Failed to connect to the database.\"}" >&2;
exit 1;
fi