Skip to content

Commit

Permalink
don't bubble up GitFileInfo errors; print to standard err
Browse files Browse the repository at this point in the history
  • Loading branch information
noahd1 committed Dec 31, 2011
1 parent 4af973d commit 694703f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions code_climate.py
@@ -1,14 +1,18 @@
import os
import sys
import urllib
import webbrowser
import git_utils
import sublime, sublime_plugin
import git_utils

class CodeClimateCommand(sublime_plugin.TextCommand):

def run(self, args):
file_info = git_utils.GitFileInfo(self.view.file_name())
params = urllib.urlencode({"repo": file_info.remote_repository(), "path": file_info.path()})
url = "https://codeclimate.com/browse?%s" % params
print "Opening URL: " + url
webbrowser.open_new(url)
try:
file_info = git_utils.GitFileInfo(self.view.file_name())
params = urllib.urlencode({"repo": file_info.remote_repository(), "path": file_info.path()})
url = "https://codeclimate.com/browse?%s" % params
print "Opening URL: " + url
webbrowser.open_new(url)
except git_utils.GitInfoError as err:
sys.stderr.write("Cannot open file in CodeClimate: " + str(err))

0 comments on commit 694703f

Please sign in to comment.