SimCenter Forum

Research in Natural Hazards Engineering => Regional Hazard Simulation (R2D, rWhale) => Topic started by: Anne Hulsey on May 22, 2020, 08:32:30 PM

Title: EQHazard: generate error codes
Post by: Anne Hulsey 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.
Title: Re: EQHazard: generate error codes
Post by: elhaddad 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.
Title: Re: EQHazard: generate error codes
Post by: Anne Hulsey on May 28, 2020, 08:28:53 PM
Great, thank you.
Title: Re: EQHazard: generate error codes
Post by: elhaddad 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 (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.
Title: Re: EQHazard: generate error codes
Post by: Anne Hulsey on May 30, 2020, 09:33:06 PM
Much appreciated!
Title: Re: EQHazard: generate error codes
Post by: elhaddad 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.