Comments (6)
More generally, I think we want to map errors to a user-defined type.
This is not the first time that it seems that errors could use a special treatment, so maybe it would be a good idea to implement such a thing.
A simple way to handle it would be to add a boolean field is_error_type
to enum definitions, however it doesn't explicit the fact that there must be one and exactly one of such type.
from stechec2.
however it doesn't explicit the fact that there must be one and exactly one of such type.
Is that something we want to enforce? I don't see why we couldn't have multiple error types for different functions.
from stechec2.
Is that something we want to enforce? I don't see why we couldn't have multiple error types for different functions.
I'm thinking about the error type attached to the API, which will be returned by actions. This "special" error type is passed as a template parameter to rules::Api
here.
from stechec2.
Yes, I know that it got recently specialized to always work that way, I'm just not sure that's a good approach. Conceptually there is really no reason why all API functions should return the same error type.
from stechec2.
The logic around errors seems very short and quite easy to generalize indeed.
from stechec2.
Migrated to https://gitlab.com/prologin/tech/tools/stechec2/-/issues/143
from stechec2.
Related Issues (20)
- generator: ocaml: flush the user_functions in C++ code, not OCaml HOT 1
- generator: handle user functions with args and a return value HOT 2
- C# generator: fix broken struct/array handling HOT 1
- generator: python errors are never shown HOT 1
- C# boolean arrays do not work
- Implement dry run mode for clients HOT 3
- Versioning/timestamp of states for TurnBasedRules HOT 3
- Add --validate-map flag to the server HOT 1
- rules generator generates french display functions HOT 1
- rules generator generates two definition for type display functions HOT 1
- Config slots option is ambiguous HOT 1
- haskell generator doesn't handle tuples
- Rust generator doesn't handle tuples of structs
- generator: more idiomatic language APIs for errors and optional values HOT 11
- Generator: add unit tests for tuples HOT 1
- Generator: command to check that a .yml compiles in all languages
- Generator: support constants of arbitrary types HOT 5
- Python generators should generate a .pyi file to enable autocompletion HOT 3
- Generator: constants are not tested in most languages HOT 1
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 stechec2.