Author Topic: EQHazard: generate error codes  (Read 18231 times)

Anne Hulsey

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
EQHazard: generate error codes
« on: May 22, 2020, 08:32:30 PM »
It would be really helpful to have error messages if EQHazard doesn't work. Currently it gives a 0 if successful and an meaningless number if it doesn't. It look me over 4 hours to discover that I had misspelled Chiou wrong in the GMPE name.

elhaddad

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: EQHazard: generate error codes
« Reply #1 on: May 27, 2020, 04:45:43 PM »
Thanks for reporting this issue. We currently do not validate the input so any mistake in the input gets reported as an unhandled exception, which in this case return a -ve error code (-2).
We will add input validation and error codes for incorrect GMPE or ERF in the next release, with distinct error codes values.

Anne Hulsey

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Re: EQHazard: generate error codes
« Reply #2 on: May 28, 2020, 08:28:53 PM »
Great, thank you.

elhaddad

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: EQHazard: generate error codes
« Reply #3 on: May 29, 2020, 11:49:04 PM »
This issue is now fixed in the latest preview release.
https://github.com/NHERI-SimCenter/GroundMotionUtilities/releases/tag/v1.1.1

We improved error handling for typos in IMR or ERF names.
For unhandled exception, the program will print the call stack, which can help debugging in the future.
We also plan to add more logging in the next release and allow user to change logging verbosity.

Anne Hulsey

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
Re: EQHazard: generate error codes
« Reply #4 on: May 30, 2020, 09:33:06 PM »
Much appreciated!

elhaddad

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: EQHazard: generate error codes
« Reply #5 on: June 03, 2020, 12:57:52 AM »
I forgot to mention the error code are listed here:
https://github.com/NHERI-SimCenter/GroundMotionUtilities/blob/master/EQHazard/src/org/designsafe/ci/simcenter/ErrorCode.java

We'll add them to the documentation with future releases.