Skip to content

Commit

Permalink
The benefit of "raise" on its own is that the original stacktrace is …
Browse files Browse the repository at this point in the history
…made available, rather than creating a new stacktrace with "raise search_error". So its easier to debug.
  • Loading branch information
David Read committed Mar 30, 2016
1 parent 3bd3e2d commit 8379b05
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ckan/logic/action/get.py
Expand Up @@ -1057,7 +1057,7 @@ def resource_show(context, data_dict):
if resource_dict['id'] == id:
break
else:
log.error('Could not find resource ' + id)
log.error('Could not find resource %s after all', id)
raise NotFound(_('Resource was not found.'))

return resource_dict
Expand Down
4 changes: 2 additions & 2 deletions ckan/logic/action/update.py
Expand Up @@ -63,7 +63,7 @@ def resource_update(context, data_dict):
context["resource"] = resource

if not resource:
log.error('Could not find resource ' + id)
log.debug('Could not find resource %s', id)
raise NotFound(_('Resource was not found.'))

_check_access('resource_update', context, data_dict)
Expand All @@ -77,7 +77,7 @@ def resource_update(context, data_dict):
if p['id'] == id:
break
else:
log.error('Could not find resource ' + id)
log.error('Could not find resource %s after all', id)
raise NotFound(_('Resource was not found.'))

for plugin in plugins.PluginImplementations(plugins.IResourceController):
Expand Down
4 changes: 2 additions & 2 deletions ckan/model/modification.py
Expand Up @@ -88,7 +88,7 @@ def notify(self, entity, operation):
log.exception(search_error)
# Reraise, since it's pretty crucial to ckan if it can't index
# a dataset
raise search_error
raise
except Exception, ex:
log.exception(ex)
# Don't reraise other exceptions since they are generally of
Expand All @@ -103,7 +103,7 @@ def notify_after_commit(self, entity, operation):
log.exception(search_error)
# Reraise, since it's pretty crucial to ckan if it can't index
# a dataset
raise search_error
raise
except Exception, ex:
log.exception(ex)
# Don't reraise other exceptions since they are generally of
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/package/snippets/package_basic_fields.html
Expand Up @@ -89,7 +89,7 @@
<label for="field-private" class="control-label">{{ _('Visibility') }}</label>
<div class="controls">
<select id="field-private" name="private">
{% for option in [('True', _('Private')), ('False', _('Public'))] %}
{% for option in [('False', _('Public')), ('True', _('Private'))] %}
<option value="{{ option[0] }}" {% if option[0] == data.private|trim %}selected="selected"{% endif %}>{{ option[1] }}</option>
{% endfor %}
</select>
Expand Down

0 comments on commit 8379b05

Please sign in to comment.