Uploaded image for project: 'ERM Platform'
  1. ERM Platform
  2. ERM-277

Document file upload errors are sometimes hidden

    XMLWordPrintable

Details

    • ERM Sprint 66, ERM Sprint 67
    • 2
    • Bienenvolk

    Description

      When a file is uploaded for a document and it fails on the backend (eg, due to the size being too large), we sometimes don't show this error or don't report it very well.

      Case One: Not reporting upload errors (stripes-erm-components)

      • Add a document and set the title of the document. The validators run and show an error about the document not being fully specified due to the fact that no location/url/file is set. This is fine.
      • Upload a file in a way that throws an error. (Eg, attempt to upload a file that is too large. Or kill the module that would handle the file upload before uploading. Or change the path used to upload files to)
      • Note that the only error shown is the one about a document not being fully specified and the user has received no feedback about the fact that the upload was attempted and failed.

      Case Two: Incorrectly showing errors (ui-licenses, ui-agreements)

      • Add a document and set the title of the document. Also set the location so that the not-specified validator passes.
      • Upload a file in a way that throws an error. (Eg, attempt to upload a file that is too large. Or kill the module that would handle the file upload before uploading. Or change the path used to upload files to)
      • Some of those methods of failure will not return JSON from the backend. As a result, this conversion to JS object from JSON will fail and throw an error. That error isn't really the one we should be showing to the user though. A more appropriate error message would be just the text itself.
      • As a result, we should attempt to convert the response to JSON, but if that fails, throw an error with the response's text itself, rather than implicitly throwing the error generated by response.json()

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                sosguthorpe Steve Osguthorpe
                md331 Mark Deutsch
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases