How to report JavaScript errors in the admin panel

You could probably make use of WP built-in notices and create one using JavaScript.

jQuery(function($){
  $('.wrap > h1').after('<div class="error notice"><p>' + 'Your error message' + '</p></div>');
});

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