[metrics-bugs] #22476 [Metrics/metrics-lib]: Replace ImplementationNotAccessibleException with RuntimeException

Tor Bug Tracker & Wiki blackhole at torproject.org
Fri Jun 2 19:47:43 UTC 2017


#22476: Replace ImplementationNotAccessibleException with RuntimeException
-------------------------------------+-------------------------------
     Reporter:  karsten              |      Owner:  metrics-team
         Type:  enhancement          |     Status:  new
     Priority:  Medium               |  Milestone:  metrics-lib 1.8.0
    Component:  Metrics/metrics-lib  |    Version:
     Severity:  Normal               |   Keywords:
Actual Points:                       |  Parent ID:
       Points:                       |   Reviewer:
      Sponsor:                       |
-------------------------------------+-------------------------------
 We're defining two custom exception classes in metrics-lib:
 `DescriptorParseException` and `ImplementationNotAccessibleException`.
 The first makes sense to me, because applications might want to catch and
 handle that.  In fact they have to, because it's a checked exception.

 But I don't see why we have `ImplementationNotAccessibleException` there.
 It's only thrown in `DescriptorSourceFactory`
 [https://gitweb.torproject.org/metrics-
 lib.git/tree/src/main/java/org/torproject/descriptor/DescriptorSourceFactory.java#n161
 in this method], and it's a runtime exception that applications shouldn't
 catch anyway.  We could easily replace it with a generic
 `RuntimeException` with the same message and have one type less in the
 API.

 I'd say that given it's a runtime exception, we can take it out in 1.8.0.
 But if that's too soon, let's deprecate it now and take it out in 2.0.0.

 Thoughts?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/22476>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the metrics-bugs mailing list