#34676: Add DistanceUnitDoesNotExist exception to contrib.gis.measure
-------------------------------------+-------------------------------------
     Reporter:  Andrew Northall      |                    Owner:  Andrew
         Type:                       |  Northall
  Cleanup/optimization               |                   Status:  assigned
    Component:  GIS                  |                  Version:  dev
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Andrew Northall):

 Replying to [comment:2 Mariusz Felisiak]:
 > I don't think that separate exception class is justified, I'd change to
 the `ValueError`.


 Thanks - if you'd rather not have a class, would it perhaps be better to
 normalise all unit not found exceptions to `AttributeError`?

 `default_units()` already returns `AttributeError` (before I changed it in
 my PR), so would it be better just to make `unit_attname()` also return
 `AttributeError` to match (and hence retain backwards compatibility with
 people who may depend on `default_units()` returning `AttributeError`?

 Or would you leave `default_units()` as `AttributeError` and have
 `unit_attname()` return `ValueError`?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34676#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070188edd7a129-1d1d25e9-f2f6-44fe-96e7-ea29548ea981-000000%40eu-central-1.amazonses.com.

Reply via email to