internal_error message

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@360 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2002-01-29 21:20:37 +00:00
parent 0c5bf66389
commit 3d119b9a45
6 changed files with 50 additions and 4 deletions

7
debian/changelog vendored
View file

@ -1,3 +1,10 @@
linkchecker (1.3.18) unstable; urgency=low
* linkcheck/HttpUrlData.py: cope with malformed http_proxy settings
* linkcheck/UrlData.py: print a nice error message for internal errors
-- Bastian Kleineidam <calvin@debian.org> Tue, 29 Jan 2002 21:57:03 +0100
linkchecker (1.3.17) unstable; urgency=low
* linkcheck/TelnetUrlData.py: fix telnet syntax checking

View file

@ -32,9 +32,9 @@ class HttpsUrlData(HttpUrlData):
return h
def check(self, config):
def _check(self, config):
if _supportHttps:
HttpUrlData.check(self, config)
HttpUrlData._check(self, config)
else:
self.setWarning(_("HTTPS url ignored"))
self.logMe(config)

View file

@ -56,6 +56,6 @@ acap # application configuration access protocol
class IgnoredUrlData(UrlData):
"""Some schemes are defined in http://www.w3.org/Addressing/schemes"""
def check(self, config):
def _check(self, config):
self.setWarning(_("%s url ignored")%self.scheme.capitalize())
self.logMe(config)

View file

@ -21,6 +21,35 @@ debug = Config.debug
from linkcheck import _
from debuglevels import *
# helper function for internal errors
def internal_error ():
print >> sys.stderr, _("""\n********** Oops, I did it again. *************
You have found an internal error in LinkChecker.
Please write a bug report to %s and include
the following information.
If you disclose some information because its too private to you thats ok.
I will try to help you nontheless (but you have to give me *something*
I can work with ;).
""") % Config.Email
import traceback
traceback.print_exc()
print_app_info()
print >> sys.stderr, _("\n******** LinkChecker internal error, bailing out ********")
sys.exit(1)
def print_app_info ():
import os
print >> sys.stderr, _("System info:")
print >> sys.stderr, Config.App
print >> sys.stderr, "Python %s on %s" % (sys.version, sys.platform)
for key in ("LC_ALL", "LC_MESSAGES", "http_proxy", "ftp_proxy"):
value = os.getenv(key)
if value is not None:
print >> sys.stderr, key, "=", `value`
# we catch these exceptions, all other exceptions are internal
# or system errors
ExcList = [
@ -207,6 +236,14 @@ class UrlData:
def check(self, config):
try:
self._check(config)
except KeyboardInterrupt:
pass
except:
internal_error()
def _check(self, config):
debug(BRING_IT_ON, "Checking", self)
if self.recursionLevel and config['wait']:
debug(BRING_IT_ON, "sleeping for", config['wait'], "seconds")

View file

@ -36,6 +36,8 @@ import Config, UrlData, sys, lc_cgi
from debuglevels import *
debug = Config.debug
# main check function
def checkUrls(config):
""" checkUrls gets a complete configuration object as parameter where all
runtime-dependent options are stored.

View file

@ -129,7 +129,7 @@ myname = "Bastian Kleineidam"
myemail = "calvin@users.sourceforge.net"
setup (name = "linkchecker",
version = "1.3.17",
version = "1.3.18",
description = "check HTML documents for broken links",
author = myname,
author_email = myemail,