Return WP_Error as WP_REST_Response

Already found, if I parse the response response.json() I get the messages in both cases

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)