summaryrefslogtreecommitdiff
path: root/rhimport/session.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-07-15 13:55:52 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-07-15 13:55:52 (GMT)
commitf4801e4f33eb9683dacefdac0687eaa217b01213 (patch)
treee6c60b6b3c3bc2dc5155b02447cb61ff70309851 /rhimport/session.go
parentb7456c5beafeeba5357db25eac195b93313647fe (diff)
normalizer can now be canceled
Diffstat (limited to 'rhimport/session.go')
-rw-r--r--rhimport/session.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/rhimport/session.go b/rhimport/session.go
index 2059525..a5f4a04 100644
--- a/rhimport/session.go
+++ b/rhimport/session.go
@@ -120,13 +120,16 @@ func sessionRun(ctx Context, done chan<- Result) {
return
}
- if err = NormalizeFile(&ctx); err != nil {
+ if res, err = NormalizeFile(&ctx); err != nil {
done <- Result{ResponseCode: http.StatusInternalServerError, ErrorString: err.Error()}
return
}
+ if res.ResponseCode != http.StatusOK {
+ done <- *res
+ return
+ }
- res, err = ImportFile(&ctx)
- if err != nil {
+ if res, err = ImportFile(&ctx); err != nil {
res.ResponseCode = http.StatusInternalServerError
res.ErrorString = err.Error()
}