question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exception hides dependency isssue

See original GitHub issue

Hi,

On my first attempt to setup django-rest-framework-gis, I stumble upon an exception thrown here:

https://github.com/djangonauts/django-rest-framework-gis/blob/master/rest_framework_gis/fields.py#L44

So I put together a small example:

>>> import json
>>> t = json.dumps({ "type":  "Point", "coordinates":[45.563237,-73.582419]})
>>> t
'{"type": "Point", "coordinates": [45.563237, -73.582419]}'
>>> GEOSGeometry(t)
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/srv/app/.virtualenvs/env/local/lib/python2.7/site-packages/django/contrib/gis/geos/geometry.py", line 64, in __init__
    raise ValueError('Initializing geometry from JSON input requires GDAL.')

which shows that the underlying issue was related to a missing library (python-gdal).

I think it’s Ok to return a ValidationError but I think it might make sense to also add the message from the captured exception so users know what went wrong.

What do you think?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
yoanisgilcommented, Dec 10, 2015

Ok. Will send you a PR then 😉

0reactions
mafuzcommented, May 10, 2019

Please am new in django I spend days trying to get pass this error to no avail when trying to migrate after installing geodjango

ValueError: String input unrecognized as WKT EWKT, and HEXEWKB.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop hiding exception raised by composer #6289 - GitHub
I have searched the existing issues Code improvement description While debugging a ... Stop hiding exception raised by composer #6289.
Read more >
What are hidden dependencies? - Stack Overflow
"A visible dependency is a dependency that developers can see from a class's interface. If a dependency cannot be seen from the class's ......
Read more >
Maven – Optional Dependencies and Dependency Exclusions
Exclusions are set on a specific dependency in your POM, and are targeted at a specific groupId and artifactId. When you build your...
Read more >
7 Common Mistakes You Should Avoid When Handling Java ...
Handling an exception in Java is one of the most common but not necessarily one of the easiest tasks. Here are several common...
Read more >
Handling Resolution Errors - Prism Library
Some common errors developers run into is a Service that was not registered or invalid XAML that generates an Exception when the View...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found