diff --git a/file.go b/file.go index 9d83733..1321ced 100644 --- a/file.go +++ b/file.go @@ -4,16 +4,14 @@ import ( "io/ioutil" "log" "os" - - "0cd.xyz-go/logger" ) // File reads request json file -func File(path string) ([]byte, *logger.HTTPError) { +func File(path string) ([]byte, error) { jsonFile, err := os.Open(path) if err != nil { log.Println("Error reading request. ", err) - return nil, &logger.HTTPError{Status: "500 Internal Server Error", StatusCode: 500} + return nil, err } defer jsonFile.Close() byteValue, _ := ioutil.ReadAll(jsonFile)