zorbash / opus

A framework for pluggable business logic components
MIT License
354 stars 21 forks source link

Update PipelineErorr typespec #26

Closed hubertlepicki closed 3 years ago

hubertlepicki commented 3 years ago

So in order to fail a stage we can raise an exception or return an {:error, whatever} tuple or just :error I believe too.

In the first case this exception will be caught and indeed PipelineErorr's :error field will contain a struct of the exception.

If you, however, fail the stage by returning error tuple, the field will contain whatever you returned.

The same situation also happens when you fail a check by returning false. In that case we'll see something like: %Opus.PipelineError{error: :failed_check_verify_signature}, i.e. atom and not a struct.

I don't think we can predict what type precisely will be there, so I think the best is to return any?

coveralls commented 3 years ago

Pull Request Test Coverage Report for Build 116


Totals Coverage Status
Change from base Build 115: 0.0%
Covered Lines: 106
Relevant Lines: 107

💛 - Coveralls
zorbash commented 3 years ago

Thank you for contributing @hubertlepicki