Skip to content

Server crashes when a non existent route is called. #97

@akashabbasi

Description

@akashabbasi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions