opensha / opensha-dev

Development sandbox for OpenSHA project
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Comcat exceptions #4

Closed mbarall closed 6 years ago

mbarall commented 6 years ago

Add exception handlers for calls to ComCat.

ComCat generates HTTP errors when it cannot find the event you're looking for. These trigger exceptions in the Java code, which were not being handled. I added handlers to catch these exceptions, and treat the exceptions the same as if ComCat had returned an empty set of results.

Note: I only modified the ComcatAccessor class in scratch.aftershockStatistics. There is another very similar ComcatAccessor class in scratch.aftershockStatisticsETAS. It should receive the same changes. I have not modified the other one because I am not set up to test scratch.aftershockStatisticsETAS. If you wish, I can modify the other ComcatAccessor and then you can test it. Note that the other ComcatAccessor also doesn't have the fix for the longitude wrap-around at 180 degrees.

kevinmilner commented 6 years ago

Thanks Michael, good catch. As for the other version, we'll merge those in when/if the ETAS version is finalized.