Error message not rendering with filter:uploadImage hook. Instead getting: "ERROR Something went wrong while parsing server response"



  • Tried tracking this down but I think it may be quicker to ask for some assistance on this one...

    This is the error I get, however I'm passing the string
    e276c99d-9848-4e8e-8358-9bf0038b7aee-image.png

    however as you can see from the next screenshot, I'm the error string "disabled account" is being passed to the callback...

    77e382e4-7894-434a-a568-6c43fe3d33ce-image.png

    I can't really find documentation on exactly what is expected from the callback function and trying to debug it hasn't been very helpful either. Hopefully someone can shed some light...

    The goal is to have a customized error message returned to the user, instead of "Something went wrong while parsing...". It would be much more helpful to let the user know that the Cloudinary (in this instance) account was a disabled account.


  • Staff Admin

    Is error just a string? Shouldn't it be an error object with a message property?

    This is the line that sends the error back to the composer.

    And the composer should handle it here Those places should let you debug further.



  • Wow! So turns out it was a silly error on my part. I had tried the Error object previously, but it was while looking at a different part of the code... I was actually looking/changing the 'imagekit' case in the code and being stumped as to why I was still seeing the behavior as I explained. Anyhow, it is working as it should when passing in an Error object. Thanks for the extra insight!


Log in to reply
 

Suggested Topics

  • 8
  • 4
  • 2
  • 9
  • 1
| |