summaryrefslogtreecommitdiff
path: root/rhimport
diff options
context:
space:
mode:
Diffstat (limited to 'rhimport')
-rw-r--r--rhimport/core.go1
-rw-r--r--rhimport/session.go8
2 files changed, 5 insertions, 4 deletions
diff --git a/rhimport/core.go b/rhimport/core.go
index 9b9cd54..fd481e4 100644
--- a/rhimport/core.go
+++ b/rhimport/core.go
@@ -61,6 +61,7 @@ type Result struct {
ErrorString string
Cart uint
Cut uint
+ SourceFile string
}
type Context struct {
diff --git a/rhimport/session.go b/rhimport/session.go
index 66705ec..f61c8fe 100644
--- a/rhimport/session.go
+++ b/rhimport/session.go
@@ -100,12 +100,12 @@ func sessionProgressCallback(step int, stepName string, progress float64, userda
func sessionRun(ctx Context, done chan<- Result) {
if err := ctx.SanityCheck(); err != nil {
- done <- Result{http.StatusBadRequest, err.Error(), 0, 0}
+ done <- Result{ResponseCode: http.StatusBadRequest, ErrorString: err.Error()}
return
}
if res, err := FetchFile(&ctx); err != nil {
- done <- Result{http.StatusInternalServerError, err.Error(), 0, 0}
+ done <- Result{ResponseCode: http.StatusInternalServerError, ErrorString: err.Error()}
return
} else if res.ResponseCode != http.StatusOK {
done <- *res
@@ -113,7 +113,7 @@ func sessionRun(ctx Context, done chan<- Result) {
}
if res, err := ImportFile(&ctx); err != nil {
- done <- Result{http.StatusInternalServerError, err.Error(), 0, 0}
+ done <- Result{ResponseCode: http.StatusInternalServerError, ErrorString: err.Error()}
return
} else {
done <- *res
@@ -190,7 +190,7 @@ func (self *Session) dispatchRequests() {
self.cancel()
}
self.state = SESSION_TIMEOUT
- r := &Result{500, "session timed out", 0, 0}
+ r := &Result{ResponseCode: http.StatusInternalServerError, ErrorString: "session timed out"}
self.callDoneHandler(r)
if self.removeFunc != nil {
self.removeFunc()