Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in error checking #222

Merged
merged 1 commit into from
Oct 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions webui/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ func branchNamesHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, err.Error())
return
Expand Down Expand Up @@ -1443,7 +1443,7 @@ func deleteBranchHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -1941,7 +1941,7 @@ func deleteCommitHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2114,7 +2114,7 @@ func deleteDataHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system, and the user has write access to it
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2225,7 +2225,7 @@ func deleteDatabaseHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "Internal server error")
return
Expand Down Expand Up @@ -2300,7 +2300,7 @@ func deleteDatabaseHandler(w http.ResponseWriter, r *http.Request) {

// Delete the database in PostgreSQL
err = com.DeleteDatabase(dbOwner, dbName)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "Internal server error")
log.Println(err)
Expand Down Expand Up @@ -2349,7 +2349,7 @@ func deleteReleaseHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2430,7 +2430,7 @@ func deleteTagHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -2981,7 +2981,7 @@ func insertDataHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system, and the user has write access to it
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4210,7 +4210,7 @@ func setDefaultBranchHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4344,7 +4344,7 @@ func tableNamesHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4525,7 +4525,7 @@ func tableViewHandler(w http.ResponseWriter, r *http.Request) {
// Make sure the database exists in the system, and the user has access to it
var exists bool
exists, err = com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4799,7 +4799,7 @@ func updateBranchHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4954,7 +4954,7 @@ func updateCommentHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false) // We don't require write access since discussions are considered public
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -4995,7 +4995,7 @@ func updateDataHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system, and the user has write access to it
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -5168,7 +5168,7 @@ func updateDiscussHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, false) // We don't require write access since MRs are considered public
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, err.Error())
return
Expand Down Expand Up @@ -5261,7 +5261,7 @@ func updateReleaseHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down Expand Up @@ -5375,7 +5375,7 @@ func updateTagHandler(w http.ResponseWriter, r *http.Request) {

// Make sure the database exists in the system
exists, err := com.CheckDBPermissions(loggedInUser, dbOwner, dbName, true)
if err != err {
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
return
}
Expand Down