Comments (5)
When this is added we should handle the case of a single line inside the block.
OK.try do
perform(action)
else
%ArgumentError{} ->
{:error, %BadRequest{}}
end
from ok.
call required not optional
from ok.
So perhaps your port
example could look like this?
port =
config
|> Map.get("port")
|> OK.required(reason: :needs_value)
from ok.
I like that.
from ok.
Added in PR #26, check it out.
from ok.
Related Issues (20)
- Alternative syntax or some sugar HOT 3
- Suggestion: Allow Only Pipes in OK.With HOT 11
- Article on errors vs exceptions HOT 1
- Suggestion/Question regarding OK.for after block HOT 5
- A module "Foo" is documented HOT 1
- Regular pipe after multiple OK pipes trigger multiple function calls HOT 5
- Nicer warnings for missing clauses HOT 1
- Does OK.with handle raised errors? HOT 13
- Dialyzer complains on `~>>` HOT 3
- Clarify semantics of OK.try rescue clause HOT 5
- README improvement to OK.success and OK.failure HOT 4
- Add mapM / sequence to OK. HOT 2
- Bind error for `~>>`
- Implement a map HOT 1
- Version 2.0 HOT 1
- use OK.Pipes HOT 1
- can I match the return text from the touple {:error, text} in case of error HOT 3
- Proposal: add `ok?` and `error?` methods HOT 3
- Allowing bare :ok and :error values HOT 3
- Result Type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ok.