Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages not fully captured #157

Closed
uniomni opened this issue May 17, 2012 · 7 comments
Closed

Error messages not fully captured #157

uniomni opened this issue May 17, 2012 · 7 comments
Assignees

Comments

@uniomni
Copy link
Contributor

uniomni commented May 17, 2012

If an error occurs, it is currently reported in the GUI and there is an option to see the stack trace.
However, the error message is not the full Python message.

For example if an impact function has a key error (e.g non existing key 'public_building' in a dictionary), the GUI reports:

No impact layer was calculated. Error message: Calculation error encountered: Problem:
'public_building'

It should have said:
KeyError: 'public_building'

The stack trace is great except that the label Toggle traceback appears twice (and so does the Problem tag)

This is not urgent, but would be good to sort out as it helps development.

@ghost ghost assigned timlinux May 17, 2012
@timlinux
Copy link
Contributor

Also causes #162

@uniomni
Copy link
Contributor Author

uniomni commented May 29, 2012

Similar problem today:
No impact layer was calculated. Error message: Terjadi kesalahan perhitungan: Problem:
2

Terjadi kesalahan perhitungan:
Problem:

2

Toggle traceback...

File "/home/nielso/.qgis/python/plugins/inasafe-dev/gui/is_impact_calculator_thread.py", line 146, in run
theFunction=self._function)
File "/home/nielso/.qgis/python/plugins/inasafe-dev/gui/is_safe_interface.py", line 417, in calculateSafeImpact
return safe_calculate_impact(theLayers, theFunction)
File "/home/nielso/.qgis/python/plugins/inasafe-dev/engine/core.py", line 56, in calculate_impact
F = impact_function.run(layers)
File "/home/nielso/.qgis/python/plugins/inasafe-dev/impact_functions/earthquake/padang_building_impact_model.py", line 102, in run
damage_params = damage_curves[building_type]

The problem here is to do with key error in the dictionary damage_curves

@uniomni
Copy link
Contributor Author

uniomni commented Jun 6, 2012

See also issue #174

@timlinux timlinux reopened this Jun 12, 2012
@timlinux
Copy link
Contributor

Reopenied as we still have the 'toggle twice issue''

@uniomni
Copy link
Contributor Author

uniomni commented Jun 13, 2012

Still not seeing the error message in relation to issue #174 - maybe there isn't one?
Could we show a token e.g. None in case the error message string is empty?

E.g. either

Calculation Error: Input layers did not overlap
or
Calculation Error: None

@timlinux
Copy link
Contributor

Ok I believe this is all neat and tidy now with no double exceptions and the second tier exception being reported as a string. I am going to have one more little pass at beautifying the stringified exception that is pulled over from SAFE by putting the trace items into an html list.

@uniomni
Copy link
Contributor Author

uniomni commented Jun 18, 2012

Looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants