Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Find a way to fix panicing goroutine test #1

Closed
cyberhck opened this issue Jan 29, 2018 · 5 comments
Closed

Find a way to fix panicing goroutine test #1

cyberhck opened this issue Jan 29, 2018 · 5 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@cyberhck
Copy link
Collaborator

That assert is commented out.
Background: right now, that's commented out because it panics inside a go routine and Assert.Panics can't capture that. Figure out what to do with this.

https://github.com/cyberhck/go-captain/blob/a8e1216ac7187ae5af42b88c5e645b9d00b7885b/job_test.go#L162-L171

@cyberhck cyberhck added help wanted Extra attention is needed question Further information is requested labels Jan 29, 2018
@cyberhck cyberhck changed the title Find a way to fix this Find a way to fix panicing goroutine test Jan 29, 2018
@matryer
Copy link

matryer commented Jan 29, 2018

Panics are hard. Have you considered an alternative way of handling errors? I don’t think an ‘error’ type should end up as a panic, because returning errors is ok and should be part of normal

@matryer
Copy link

matryer commented Jan 29, 2018

... flow. Panics are messages to developers.

@cyberhck
Copy link
Collaborator Author

Thanks for immediate response.

hmm. I don't know what I should do in this context, do you have any suggestions as to what to do on this condition? Idea is if runtime processor returns an error we should abort, or something.

Or do you think runtime shouldn't really return anything, they're just kind of hooks, do you think we want to return anything at all?

@matryer
Copy link

matryer commented Jan 29, 2018 via email

@cyberhck
Copy link
Collaborator Author

closing this, I'm gonna remove the ability to return an error so we can use the Adapter pattern too :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants