Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Chiefs
ChiefSend2
Commits
be9cf33e
Commit
be9cf33e
authored
Mar 28, 2021
by
Lukas Böhm
🎱
Browse files
fehlerbehandlung
parent
3732d7c5
Changes
1
Show whitespace changes
Inline
Side-by-side
api/api.go
View file @
be9cf33e
...
...
@@ -308,7 +308,6 @@ func DownloadZip(w http.ResponseWriter, r *http.Request) *HTTPError {
if
err
!=
nil
{
return
&
HTTPError
{
err
,
"error opening file"
,
500
}
}
defer
fileToZip
.
Close
()
info
,
err
:=
fileToZip
.
Stat
()
if
err
!=
nil
{
...
...
@@ -327,7 +326,13 @@ func DownloadZip(w http.ResponseWriter, r *http.Request) *HTTPError {
if
err
!=
nil
{
return
&
HTTPError
{
err
,
"error creating header"
,
500
}
}
_
,
err
=
io
.
Copy
(
writer
,
fileToZip
)
if
_
,
err
:=
io
.
Copy
(
writer
,
fileToZip
);
err
!=
nil
{
return
&
HTTPError
{
err
,
"error copying file into zip archive"
,
500
}
}
if
err
:=
fileToZip
.
Close
();
err
!=
nil
{
return
&
HTTPError
{
err
,
"error closing zip archive"
,
500
}
}
}
err
=
zipWriter
.
Close
()
if
err
!=
nil
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment