Uploaded image for project: 'ui-inventory'
  1. ui-inventory
  2. UIIN-1527

Error popup on HTTP error status code (500, 400, 409, ...)

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P2
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
    • Template:
    • Sprint:
      Prokopovych - Sprint 115, Prokopovych - Sprint 116, Prokopovych - Sprint 117
    • Story Points:
      3
    • Development Team:
      Prokopovych

      Description

      When a back-end save request fails with an error HTTP status code like 500, 400, 409, ... the front-end should open an error popup showing the HTTP status code and the HTTP status message.

      How to reproduce with tamper dev:

      Use Chrome

      Install https://tamper.dev/

      Open "Semantic web primer" for editing: https://folio-snapshot.dev.folio.org/inventory/edit/5bf370e0-8cca-4d9c-82e4-5170ab2a0a39/instance?query=%2A&sort=title

      Change a character in the title.

      Press Alt+T to open tamper dev and enable "Intercept requests".

      On "Semantic web primer" press "Save and close".

      In tamper dev send the OPTIONS request unchanged,
      and for the PUT request change the HTTP status code from 204 to 500.

      Actual result: Nothing happens, the edit form stays open without any error message.

      Expected result: Error popup showing HTTP status code and HTTP status message.

      The same when saving holdings or item.

      How to reproduce with nginx:

      Use this Vagrant file:

      Vagrant.configure("2") do |config|
        config.vm.box = "folio/snapshot-core"
        config.vm.network "forwarded_port", guest: 9130, host: 9130, disabled: true
        config.vm.network "forwarded_port", guest: 9130, host: 9129
      end
      

      Run nginx in front of Vagrant with this configuration:

      server {
              listen 9130;
              client_max_body_size 200m;
              location / {
                      proxy_pass http://127.0.0.1:9129;
                      proxy_redirect default;
              }        
              # A semantic web primer
              location /inventory/instances/5bf370e0-8cca-4d9c-82e4-5170ab2a0a39 {
                      if ($request_method = PUT) {
                              add_header 'Access-Control-Allow-Origin' '*' always;
                              return 409 'Optimistic Locking Conflict';
                      }
                      proxy_pass http://127.0.0.1:9129/inventory/instances/5bf370e0-8cca-4d9c-82e4-5170ab2a0a39;
                      proxy_redirect default;
              }
      } 

      Open "A semantic web primer" for editing: http://localhost:3000/inventory/edit/5bf370e0-8cca-4d9c-82e4-5170ab2a0a39/instance

      Change a character in the title.

      Press "Save and close".

      Actual result: Nothing happens, the edit form stays open without any error message.

      Expected result: Error popup showing "409 Optimistic Locking Conflict".

      The same when saving holdings or item.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mpk35 Michal Kuklis
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases