mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 01:22:13 -06:00
error handling
This commit is contained in:
parent
051c782c28
commit
456fab2e0b
|
@ -642,7 +642,11 @@ class HttpCli(object):
|
|||
href = "/" + vpath + "/" + fn
|
||||
|
||||
fspath = fsroot + "/" + fn
|
||||
inf = os.stat(fsenc(fspath))
|
||||
try:
|
||||
inf = os.stat(fsenc(fspath))
|
||||
except FileNotFoundError as ex:
|
||||
self.log("broken symlink: {}".format(fspath))
|
||||
continue
|
||||
|
||||
is_dir = stat.S_ISDIR(inf.st_mode)
|
||||
if is_dir:
|
||||
|
|
|
@ -183,7 +183,7 @@ class MultipartParser(object):
|
|||
buf = self.sr.recv(bufsz)
|
||||
if not buf:
|
||||
# abort: client disconnected
|
||||
raise Pebkac(400, "client disconnected during post")
|
||||
raise Pebkac(400, "client disconnected during multipart post")
|
||||
|
||||
while True:
|
||||
ofs = buf.find(self.boundary)
|
||||
|
@ -217,7 +217,7 @@ class MultipartParser(object):
|
|||
buf2 = self.sr.recv(bufsz)
|
||||
if not buf2:
|
||||
# abort: client disconnected
|
||||
raise Pebkac(400, "client disconnected during post")
|
||||
raise Pebkac(400, "client disconnected during multipart post")
|
||||
|
||||
buf += buf2
|
||||
|
||||
|
@ -397,6 +397,9 @@ def read_socket(sr, total_size):
|
|||
bufsz = remains
|
||||
|
||||
buf = sr.recv(bufsz)
|
||||
if not buf:
|
||||
raise Pebkac(400, "client disconnected during binary post")
|
||||
|
||||
remains -= len(buf)
|
||||
yield buf
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
* {
|
||||
line-height: 1.2em;
|
||||
}
|
||||
html,body,tr,th,td,#files,a {
|
||||
color: inherit;
|
||||
background: none;
|
||||
|
@ -11,7 +14,6 @@ html {
|
|||
background: #333;
|
||||
font-family: sans-serif;
|
||||
text-shadow: 1px 1px 0px #000;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
html, body {
|
||||
margin: 0;
|
||||
|
@ -23,7 +25,6 @@ body {
|
|||
#path,
|
||||
#path * {
|
||||
font-size: 1em;
|
||||
line-height: 1em;
|
||||
}
|
||||
#path {
|
||||
color: #aca;
|
||||
|
@ -168,7 +169,6 @@ a.play.act {
|
|||
text-align: center;
|
||||
background: #444;
|
||||
border-radius: 2em;
|
||||
line-height: 1em;
|
||||
}
|
||||
#widget {
|
||||
position: fixed;
|
||||
|
@ -246,7 +246,6 @@ a.play.act {
|
|||
font-size: 1.25em;
|
||||
width: 1.3em;
|
||||
height: 1.2em;
|
||||
line-height: 1em;
|
||||
text-align: center;
|
||||
margin-right: .5em;
|
||||
border-radius: .3em;
|
||||
|
|
Loading…
Reference in a new issue