How To Provide Users With Useful Cloudinary Exception Response in Rails?

Comments

1 comment

  • Avatar
    Itay Taragano

    Hi Alexander,

    If you wish to keep the uploads being performed on the server-side, then you can use something like the following:

    begin
    upload = Cloudinary::Uploader.upload(self.picture_link.to_s)
    rescue CloudinaryException => e

    #Perform handling code, for example:

    msg_to_display = e.message
    end

    Alternatively, you might want to consider performing the uploads client-side, i.e., uploading images  directly from the browser to Cloudinary. This way, you can use our jQuery library to validate the uploads on the client-side, before uploading the file to Cloudinary.

    0
    Comment actions Permalink

Please sign in to leave a comment.