Skip to content

Commit

Permalink
Removed unfinished error page logic
Browse files Browse the repository at this point in the history
There were attempts to implement an error html page, but they have not been finished yet. The partially complete functionality in abortWithError was mistakenly pushed GitHub.
  • Loading branch information
rstrom1763 committed Jun 24, 2024
1 parent a1853a8 commit 276dff1
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,15 +312,7 @@ func setToken(r *redis.Client, username string, token string) {

// Returns error code and ends handler function for gin routes
func abortWithError(statusCode int, err error, c *gin.Context) {

_ = c.AbortWithError(statusCode, err)
//c.JSON(statusCode, gin.H{"status": fmt.Sprint(err)})
errorPage, err := os.ReadFile("./static/error.html")
if err != nil {
log.Fatal(err)
}
c.Data(statusCode, "text/html; charset=utf-8", errorPage)

c.JSON(statusCode, gin.H{"status": fmt.Sprint(err)})
}

func generateSSL() {
Expand Down

0 comments on commit 276dff1

Please sign in to comment.