write error messages to stderr
This commit is contained in:
@@ -15,6 +15,7 @@ __maintainer__ = "Mike Fährmann"
|
|||||||
__email__ = "mike_faehrmann@web.de"
|
__email__ = "mike_faehrmann@web.de"
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
from . import config, extractor, job, exception
|
from . import config, extractor, job, exception
|
||||||
@@ -74,7 +75,7 @@ def parse_option(opt):
|
|||||||
pass
|
pass
|
||||||
config.set(key.split("."), value)
|
config.set(key.split("."), value)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print("Invalid 'key=value' pair:", opt)
|
print("Invalid 'key=value' pair:", opt, file=sys.stderr)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
@@ -113,13 +114,14 @@ def main():
|
|||||||
try:
|
try:
|
||||||
jobtype(url).run()
|
jobtype(url).run()
|
||||||
except exception.NoExtractorError:
|
except exception.NoExtractorError:
|
||||||
print("No suitable extractor found for URL '", url, "'", sep="")
|
print("No suitable extractor found for URL '", url, "'",
|
||||||
|
sep="", file=sys.stderr)
|
||||||
except exception.AuthenticationError:
|
except exception.AuthenticationError:
|
||||||
print("Authentication failed. Please provide a valid "
|
print("Authentication failed. Please provide a valid "
|
||||||
"username/password pair.")
|
"username/password pair.", file=sys.stderr)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("\nKeyboardInterrupt")
|
print("\nKeyboardInterrupt", file=sys.stderr)
|
||||||
except BrokenPipeError:
|
except BrokenPipeError:
|
||||||
pass
|
pass
|
||||||
except IOError as e:
|
except IOError as e:
|
||||||
|
|||||||
Reference in New Issue
Block a user