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

How to handle error NotFoundException: startSize = 0 #65

Closed
JamesKrub opened this issue Mar 20, 2024 · 1 comment
Closed

How to handle error NotFoundException: startSize = 0 #65

JamesKrub opened this issue Mar 20, 2024 · 1 comment

Comments

@JamesKrub
Copy link

please kindly recommend me to check specific error without using like this in Golang

err.Error() == "NotFoundException: startSize = 0"

@makiuchi-d
Copy link
Owner

Using errors.As:

var t gozxing.NotFoundException
if errors.As(err, t) {
	fmt.Println("Not found exception")
}

Or, using type assertion:

_, ok := err.(gozxing.NotFoundException)
if ok {
	fmt.Println("Not found exception")
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants