mirror of
https://github.com/clearlinux/docker.git
synced 2026-10-04 15:58:39 +00:00
Use the new error package
This is the first step in converting out static strings into well-defined error types. This shows just a few examples of it to get a feel for how things will look. Once we agree on the basic outline we can then work on converting the rest of the code over. Signed-off-by: Doug Davis <dug@us.ibm.com>
This commit is contained in:
+2
-1
@@ -3,6 +3,7 @@ package server
|
||||
import (
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
@@ -335,7 +336,7 @@ func (s *Server) postBuild(version version.Version, w http.ResponseWriter, r *ht
|
||||
return err
|
||||
}
|
||||
sf := streamformatter.NewJSONStreamFormatter()
|
||||
w.Write(sf.FormatError(err))
|
||||
w.Write(sf.FormatError(errors.New(utils.GetErrorMessage(err))))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user