<div dir="auto"><div dir="auto">In pyproj, we use a custom log function to catch the error log messages:</div><div dir="auto"><a href="https://github.com/pyproj4/pyproj/blob/0221652c4cce274d72b0a82305d82c13e4b0535b/pyproj/_datadir.pyx#L9" target="_blank" rel="noreferrer">https://github.com/pyproj4/pyproj/blob/0221652c4cce274d72b0a82305d82c13e4b0535b/pyproj/_datadir.pyx#L9</a><br></div><div dir="auto"><br></div><div dir="auto">And pass the custom function into `proj_log_func`: </div><div dir="auto"><a href="https://github.com/pyproj4/pyproj/blob/0221652c4cce274d72b0a82305d82c13e4b0535b/pyproj/_datadir.pyx#L35">https://github.com/pyproj4/pyproj/blob/0221652c4cce274d72b0a82305d82c13e4b0535b/pyproj/_datadir.pyx#L35</a></div><div dir="auto"><br></div><div dir="auto">Hope this helps,</div><div dir="auto">Alan</div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 30, 2019, 10:13 PM Nyall Dawson <<a href="mailto:nyall.dawson@gmail.com" target="_blank" rel="noreferrer">nyall.dawson@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi list,<br>
<br>
What's the correct way to get errors as a result of a<br>
proj_create_operations call? When trying to create a (deliberately)<br>
bad operation, I can see on the console that proj throws a nice<br>
descriptive warning:<br>
<br>
"internal_proj_create_operations: Source and target ellipsoid do not<br>
belong to the same celestial body"<br>
<br>
And, as expected, the function returns a nullptr. I'm trying to<br>
retrieve this descriptive error string for display to users, but can't<br>
work out how to do this. I can't use proj_errno, since I don't have a<br>
object to retrieve from. And if I try to retrieve from the context<br>
using proj_context_errno, I just get a -61 "generic error of unknown<br>
origin" message.<br>
<br>
Any suggestions?<br>
<br>
Nyall<br>
_______________________________________________<br>
PROJ mailing list<br>
<a href="mailto:PROJ@lists.osgeo.org" rel="noreferrer noreferrer" target="_blank">PROJ@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/proj" rel="noreferrer noreferrer noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/proj</a><br>
</blockquote></div>