Giter VIP home page Giter VIP logo

Comments (6)

florentmx avatar florentmx commented on June 29, 2024 4

I personally would think that the easiest and most versatile solution would be to attach a simple dictionary to the error itself. Simple string as the key and an object as the value. My PR #37 could be used like this:

var metadata = new Dictionary<string, object>();
metadata.Add("id", 13947);

var error = Error.Failure("404", "entity not found", metadata);

Let me know what you think.

from error-or.

kgnet88 avatar kgnet88 commented on June 29, 2024 3

Different use cases:

  1. environment metadata (helpful if the customer gives you only a screenshot of an error)
  2. user context (session data, etc)
  3. working with background APIs you may want to know which component is the real culprit (or if it was a resillience error)
  4. compressed stacktrace, compressed binary log data

And this are only the ones on top of my head or ones I already have encountered.

from error-or.

amantinband avatar amantinband commented on June 29, 2024

Hmm, this is an interesting idea. What kind of metadata are we talking about? Is this a specific recurring object you want to attach to all errors? a string? Can you elaborate on the use case?

from error-or.

shanerogers avatar shanerogers commented on June 29, 2024

@amantinband Good evening. I was looking at using ErrorOr<> in our solution.
Currently, we use fluent validation with https://github.com/shanerogers/language-ext.

More specifically Result This is similar to your example (in docs) with mediatR with behaviours.

However, I also need meta-data used in our problem json responses. So this is also a blocker for me.
Also worth mentioning. Is it possible to have 'PropertyName' as a field? So each error can have the following:

  • ErrorCode
  • PropertyName
  • Description
  • ErrorType
  • Metadata

I also find the Numeric type isn't something I need. Also, wondering how that works with 'Custom' types.

from error-or.

vendre21 avatar vendre21 commented on June 29, 2024

I would really need this

from error-or.

amantinband avatar amantinband commented on June 29, 2024

Added since I see many of you want this feature. Should be available in version 1.4.0 🙂

from error-or.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.