Skip creation if exists and definitely log PANICs
This commit is contained in:
parent
b23ade4cd8
commit
b1de6737f0
@ -288,9 +288,10 @@ async def handle_pad(args, padid, data, info, session):
|
|||||||
if args.all or (args.meta or args.text or args.html or args.dhtml):
|
if args.all or (args.meta or args.text or args.html or args.dhtml):
|
||||||
try:
|
try:
|
||||||
path = trio.Path(os.path.split(metapath)[0])
|
path = trio.Path(os.path.split(metapath)[0])
|
||||||
await path.mkdir()
|
if not os.path.exists(path):
|
||||||
except OSError:
|
await path.mkdir()
|
||||||
print("PANIC: unable to create {}".format(str(path)))
|
except OSError as exception:
|
||||||
|
print("PANIC: {}".format(exception))
|
||||||
|
|
||||||
if args.all or args.text:
|
if args.all or args.text:
|
||||||
url = info["localapiurl"] + "getText?" + urlencode(data)
|
url = info["localapiurl"] + "getText?" + urlencode(data)
|
||||||
|
Loading…
Reference in New Issue
Block a user