Comments (4)
The democratic consensus above is that we'll clean that up so we can do throw new SpeckleException( ... )
instead of Log.CaptureAndThrow()
, so it stays open :D
The SpeckleException class will have multiple constructors covering any cases we might want to wrap around.
TBH, it's my fault - we discussed the Log.CaptureAndThrow()
approach in the past when you've implemented it, but I wasn't awake enough to catch it in time...
from speckle-sharp.
Yep, the extra doesn't seem to be carried over in the exception here:
https://github.com/specklesystems/Core/blob/25c08e7e3fd3232b1d20b466a7c8f5330d59c4bb/Core/Logging/Log.cs#L67-L76
I also feel like - this might be a bikeshed design moment - it would be a bit more natural to invert the ops a bit. What do i mean by this:
- in code, just
throw new SpeckleException( ... )s
- which can be constructed from GQL errors, like above, or from normal exceptions - in the constructors, do a
Log.Capture( ... )
This would change this:
to
public async Task<User> UserGet()
{
try
{
var request = new GraphQLRequest
{
Query = etc
};
var res = await GQLClient.SendMutationAsync<UserData>(request);
if (res.Errors != null)
throw new SpeckleException( res.errors );
return res.Data.user;
}
catch (Exception e)
{
throw new SpeckleException( e );
}
}
from speckle-sharp.
I like this idea! Feels more natural to be throwing a SpeckleException
rather than faffing with capturing and throwing. imho easier to use and cleaner to read ✨
from speckle-sharp.
Okay, this should be fixed with: ee3edc9#diff-76acbbd665fda0e26440acdb0d57074b4183fe02631e41b17bc9d7aebd2d83ebR52
It's now returning the first gql error. Initially I had standardized on predefined error messages to be able to group these exceptions in Sentry. Feel free to close @didimitrie
from speckle-sharp.
Related Issues (20)
- feat(revit/objects): new rebar class and sending rebar from revit HOT 1
- Bug: Reading in `speckle_type` from Server HOT 5
- Meshes in displayValue have area and volume as zero. HOT 2
- Enhancement: Integrating material_quantities into the ArchiCAD converter. HOT 2
- revit: cutback parameters not set for framing on receive HOT 1
- Compatibility with ETABS 21
- My Fake ticket, testing! HOT 6
- New issue
- ARCHICAD Converter: No BuildingMaterial for Windows and not all Components HOT 3
- ARCHICAD converter: Beams and columns do not have the profile information.
- SetRelationship (in CommitObjectBuilder) throws "an item with the same key has already been added" exception HOT 6
- Enhancement: Civil 3D Corridor Baseline and Cross Section Data HOT 2
- feat(archicad): Add support for openings
- feat(archicad): Add certification to "ConnectorArchicad.exe"
- feat(archicad): Update connector icon on Mac HOT 1
- feat(archicad): Add default commit message
- Civil connector will not allow selection of corridors to push
- Revit floors with slab shape points
- Bug: Rhino Converter throws an error when unnamed collections are filtered HOT 2
- Revit Connector: doesn't apply ParameterUpdater using applicationId 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 speckle-sharp.