Ticket #8730 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

[ICAT] Better IDS error handling

Reported by: Jay Rainey Owned by: Jay Rainey
Priority: major Milestone: Release 3.1
Component: Framework Keywords: ICAT
Cc: Blocked By:
Blocking: #8727 Tester: Arturs Bekasovs

Description

Currently, CatalogPublish cancels the algorithm and outputs a custom error message to the user informing them what we think the problem was.

A better solution is to obtain the JSON body returned in the response from the server and output the content in the format of: code + " :" + message where code and message are JSON properties.

For example, when a 404 occurs the following status and body is returned:

  Status: 404 (not found)
  Body: json response:
  {
    "code"   : "NotFoundException",
    "message":"Datafile[id:43341911] not found."
  }

Change History

comment:1 Changed 7 years ago by Jay Rainey

  • Status changed from new to inprogress

Use error message returned from IDS. Refs #8730.

Changeset: 4b12bb85fe27be6b49e1be63d67ad8d1a9fadeb0

comment:2 Changed 7 years ago by Jay Rainey

  • Status changed from inprogress to verify
  • Resolution set to fixed

Note

  • You can only publish data to investigations of which you are an investigator on.
  • You can only test this ticket if you have results in "my data". (E.g. you are an investigator in investigations.)

To test

Change Facilities.xml

You will need to change the soapendpoint and externaldownload in Facilities.xml to:

  soapendpoint     -> "https://icatdev.isis.cclrc.ac.uk/ICATService/ICAT"
  externaldownload -> "https://isisoxfordvmsrv.isis.cclrc.ac.uk/ids/"

Publishing a file

In order to produce an error from the IDS one way is to publish a file, and then publish again with the same details (as a same name error will be thrown). To do this:

  1. Log into the catalog.
  2. Select "Publish" and select a file to upload.
  3. Provide a name for the file (E.g. example1234.nxs).
  4. Press "Run". The file will now be uploaded to the archives.
  5. Open the dialog again (it should have the same settings) and press "Run". This will attempt to publish the datafile to the archives as before. However, as a file with the same name exists it should produce a suitable error that makes this obvious.

comment:3 Changed 7 years ago by Arturs Bekasovs

  • Status changed from verify to verifying
  • Tester set to Arturs Bekasovs

comment:4 Changed 7 years ago by Arturs Bekasovs

Seems to be working as described. I've uploaded a file, then tried to upload it again which resulted in an error. The error message was informative enough for me to understand what has gone wrong.

There is an unrelated problem I've found while using the catalog - you are able to publish a file of any type, though when trying to load e.g. a PNG file to Mantid an exception is thrown, saying that the loader for that type of file was not found. The exception should be caught and handled properly.

comment:5 Changed 7 years ago by Arturs Bekasovs

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8730_icat_improve_ids_exception_handling'

Full changeset: 750af378b844155a9c15cab08c550aece91b4a13

comment:6 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9574

Note: See TracTickets for help on using tickets.