Is there an equivalent to WP_Error object I can return in the case of a successful REST request?

I think you are looking for WP_REST_Response.

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