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

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

Open
akashabbasi opened this issue Mar 10, 2024 · 2 comments
Open

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

akashabbasi opened this issue Mar 10, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@akashabbasi
Copy link

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.

Copy link

Welcome to go-ecommerce-microservices. Thank you for reporting your first issue. Please check out our contributor guide.

@mehdihadeli mehdihadeli added the bug Something isn't working label Mar 10, 2024
@mehdihadeli
Copy link
Owner

Hi,
Thanks for reporting, I probably missed that.
I will fix it in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants