getsentry / sentry-jira

A Plugin for sentry that lets you create JIRA issues
Other
95 stars 32 forks source link

Correct value error and some minor cleanup #45

Closed dcramer closed 11 years ago

dcramer commented 11 years ago
Stacktrace (most recent call last):

  File "django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "sentry/web/decorators.py", line 110, in _wrapped
    return func(request, *args, **kwargs)
  File "django/utils/decorators.py", line 91, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "sentry/web/frontend/projects.py", line 305, in configure_project_plugin
    action, view = plugin_config(plugin, project, request)
  File "sentry/web/helpers.py", line 197, in plugin_config
    prefix=plugin_key
  File "sentry_jira/forms.py", line 46, in __init__
    projects_response = jira.get_projects_list()
  File "sentry_jira/jira.py", line 30, in get_projects_list
    return self.get_cached(self.PROJECT_URL)
  File "sentry_jira/jira.py", line 69, in get_cached
    cached_result = self.make_request('get', full_url)
  File "sentry_jira/jira.py", line 58, in make_request
    return JIRAResponse("There was a problem reaching %s: %s" % (url, e.message), 500)
  File "sentry_jira/jira.py", line 85, in __init__
    self.json = json.loads(response_text, object_pairs_hook=SortedDict)
  File "sentry/utils/json.py", line 39, in loads
    return json.loads(value, object_hook=better_decoder)
  File "json/__init__.py", line 339, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
dcramer commented 11 years ago

Feel free to cherry-pick if you dont want the lint cleanup :)

thurloat commented 11 years ago

looks fine to me, am surprised that the JSON decoder would throw that exception though.

"No JSON object could be decoded" sounds like a JSONDecodeError to me ...