mirror of
https://github.com/Luzifer/tex-api.git
synced 2024-11-12 18:12:43 +00:00
Fix broken error handling
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
e0805011b5
commit
b86f1dbb64
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -138,7 +138,7 @@ func startNewJob(res http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
if f, err := os.Create(inputFile); err == nil {
|
if f, err := os.Create(inputFile); err == nil {
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
if _, copyErr := io.Copy(f, r.Body); err != nil {
|
if _, copyErr := io.Copy(f, r.Body); copyErr != nil {
|
||||||
serverErrorf(res, copyErr, "Unable to copy input file %q", inputFile)
|
serverErrorf(res, copyErr, "Unable to copy input file %q", inputFile)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ func getJobStatus(res http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if status, err := loadStatusByUUID(uid); err == nil {
|
if status, err := loadStatusByUUID(uid); err == nil {
|
||||||
if encErr := json.NewEncoder(res).Encode(status); err != nil {
|
if encErr := json.NewEncoder(res).Encode(status); encErr != nil {
|
||||||
serverErrorf(res, encErr, "Unable to serialize status file")
|
serverErrorf(res, encErr, "Unable to serialize status file")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue