Files
Paul NicolasandGitHub b8a4fd2de7 fix(models): fix bank account ik and internal error not logging (#420)
This commit fixes:

- The bank account IdempotencyKey that was not unique by related
   bank account created
- Internal server error was not logging the right error
2025-04-23 13:13:43 +02:00

15 lines
411 B
Go

package common
import (
"errors"
"net/http"
"github.com/formancehq/go-libs/v3/api"
"github.com/formancehq/go-libs/v3/logging"
)
func InternalServerError(w http.ResponseWriter, r *http.Request, err error) {
logging.FromContext(r.Context()).Error(err)
api.WriteErrorResponse(w, http.StatusInternalServerError, api.ErrorInternal, errors.New("Internal error. Consult logs/traces to have more details."))
}