Skip to content

Commit

Permalink
Fix a linter error about shadowing the error type
Browse files Browse the repository at this point in the history
  • Loading branch information
svanharmelen committed Nov 22, 2024
1 parent bb04dd3 commit 2f7e9f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/ConnectionSelection.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func NewConnectionSelection(connectionForm *ConnectionForm, connectionPages *mod

err := helpers.SaveConnectionConfig(newConnections)
if err != nil {
ConnectionListTable.SetError(err.Error())
ConnectionListTable.SetError(err)
} else {
ConnectionListTable.SetConnections(newConnections)
}
Expand Down
9 changes: 4 additions & 5 deletions components/ConnectionsTable.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func NewConnectionsTable() *ConnectionsTable {
connections, err := helpers.LoadConnections()

if err != nil {
table.SetError(err.Error())
table.SetError(err)
} else {
table.SetConnections(connections)
}
Expand Down Expand Up @@ -74,8 +74,7 @@ func (ct *ConnectionsTable) SetConnections(connections []models.Connection) {
App.ForceDraw()
}

func (ct *ConnectionsTable) SetError(error string) {
ct.error = error

ct.errorTextView.SetText(error)
func (ct *ConnectionsTable) SetError(err error) {
ct.error = err.Error()
ct.errorTextView.SetText(ct.error)
}

0 comments on commit 2f7e9f4

Please sign in to comment.