Skip to content

Commit

Permalink
[#3360] format exception instead of passing to error()
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Dec 8, 2016
1 parent 124547a commit 621c9c0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ckan/lib/cli.py
Expand Up @@ -13,6 +13,7 @@
import logging
import urlparse
from optparse import OptionConflictError
import traceback

import sqlalchemy as sa
import routes
Expand Down Expand Up @@ -851,7 +852,7 @@ def add(self):
user_dict = logic.get_action('user_create')(context, data_dict)
pprint(user_dict)
except logic.ValidationError, e:
error(e)
error(traceback.format_exc())

def remove(self):
import ckan.model as model
Expand Down Expand Up @@ -1492,9 +1493,7 @@ def profile_url(url):
except KeyboardInterrupt:
raise
except:
import traceback
traceback.print_exc()
print 'Unknown error: ', url.strip()
error(traceback.format_exc())

output_filename = 'ckan%s.profile' % re.sub('[/?]', '.', url.replace('/', '.'))
profile_command = "profile_url('%s')" % url
Expand Down Expand Up @@ -2478,7 +2477,7 @@ def command(self):
config_filepath, options, self.options.section,
edit=self.options.edit)
except config_tool.ConfigToolError, e:
error(e)
error(traceback.format_exc())


class JobsCommand(CkanCommand):
Expand Down

0 comments on commit 621c9c0

Please sign in to comment.