Matheus Querido 6 years ago
parent
commit
23c316b854
1 changed files with 3 additions and 4 deletions
  1. 3 4
      main.go

+ 3 - 4
main.go

10
 	req "./core/request"
10
 	req "./core/request"
11
 	res "./core/response"
11
 	res "./core/response"
12
 	"./routes"
12
 	"./routes"
13
-	errorHandler "./src/lib/error"
13
+	"./src/lib/errors"
14
 )
14
 )
15
 
15
 
16
 func main() {
16
 func main() {
25
 	database.Init(dbConfig)
25
 	database.Init(dbConfig)
26
 
26
 
27
 	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
27
 	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
28
-		var Errors errorHandler.Errors
29
 
28
 
30
 		res.SetResponseWriter(w)
29
 		res.SetResponseWriter(w)
31
 		req.SetRequest(r)
30
 		req.SetRequest(r)
32
 
31
 
33
 		if !database.IsConnected {
32
 		if !database.IsConnected {
34
-			Errors.InternalError("Conexão com a base de dados falhou!")
35
-			res.JSON(Errors)
33
+			errors.InternalError("Conexão com a base de dados falhou!")
34
+			res.JSON(errors)
36
 			return
35
 			return
37
 		}
36
 		}
38
 
37