Search code examples
admin-on-rest

message notification error catch admin-on-rest


I try to show in notification the error of the catch like this:

  .catch(e => {
    console.error('catch', e);
    showNotification(e, 'warning');
  });

This doesn't work.

I follow the instructions on Actions admin-on-rest

In this are examples like:

        .catch((e) => {
            console.error(e);
            showNotification('Error: comment not approved', 'warning')
        });

but I want to show in showNotification the e message.

How can I do this?


Solution

  • i already resolved it.

       .catch(e => {
            console.error('Error en handleUploadFile: ', e);
            showNotification(`Error: ${e.message}`, 'warning');
          });