Server crashes when a non existent api is called on server. Error occurs in error parsing step. Specifically on below lines.
func ParseError(err error) ProblemDetailErr {
stackTrace := errorUtils.ErrorsWithStack(err)
customErr := customErrors.GetCustomError(err)
var validatorErr validator.ValidationErrors
if err != nil {
switch {
case customErrors.IsDomainError(err, customErr.Status()):
return NewDomainProblemDetail(customErr.Status(), customErr.Error(), stackTrace)
2nd line of function returns nil when we try to create custom error. and subsequent calls on nil causes panic which causes crash.
Server crashes when a non existent api is called on server. Error occurs in error parsing step. Specifically on below lines.
func ParseError(err error) ProblemDetailErr {
stackTrace := errorUtils.ErrorsWithStack(err)
customErr := customErrors.GetCustomError(err)
var validatorErr validator.ValidationErrors
2nd line of function returns nil when we try to create custom error. and subsequent calls on nil causes panic which causes crash.