These are chat archives for damianh/Cedar

4th
Jun 2015
Yves Reynhout
@yreynhout
Jun 04 2015 12:03
MapProblemDetailsFromException delegate - hm, inadequate me thinks, at least from a consumption POV. Needs a syntax that is somewhat similar to CommandHandlerModule.
For<MyException>(exception => exception.MapToProblemDetails()).For<MyOtherException>(exception => exception.MapToProblemDetails()) ... and then
João Bragança
@thefringeninja
Jun 04 2015 12:06
yep!
Yves Reynhout
@yreynhout
Jun 04 2015 12:07
have some "MapProblemDetailsFromException ExceptionTranslator = exception => if (dictionary.TryGetValue(exception.GetType(), out mapper)) return mapper(); else return null;)"
João Bragança
@thefringeninja
Jun 04 2015 12:07
i think it might need to be polymorphic since in some projects cough there is a base domain exception
Yves Reynhout
@yreynhout
Jun 04 2015 12:08
where the dictionary is a composition of the For<>() syntax above. Now whether you want that in the box is a different question. Would leave it out and let every body do his own thing.
No poly needed, the .ToProblemDetails() is on said base exception :-)
or you could have a more specific one if need be ;-)
Way ahead of you ...
:trollface:
João Bragança
@thefringeninja
Jun 04 2015 12:09
i'm a little slow today
Yves Reynhout
@yreynhout
Jun 04 2015 12:09
I'm kidding
João Bragança
@thefringeninja
Jun 04 2015 12:10
i'm not
(yesterday was leg day)
Yves Reynhout
@yreynhout
Jun 04 2015 12:12
what is leg day?
Damian Hickey
@damianh
Jun 04 2015 12:42
There is impedance mismatch between polymorphic types (exceptions) and messages - (that's a general statement)
I didn't do the whole exception mapping module thing mostly because yagni...
That is, I didn't know how many exception types people are going to end up wanting to convert to (custom) problem details.
Yves Reynhout
@yreynhout
Jun 04 2015 12:43
In my case, lots :-)
But no worries, rolling my own
I think it's the proper extensibility point - no need to hold my hand further
Damian Hickey
@damianh
Jun 04 2015 12:44
Let's see how that rolls before adopting it.
I mean adopting it within the lib
cool
Yves Reynhout
@yreynhout
Jun 04 2015 12:45
wouldn't do that - yet another piece of code to maintain - recipes (as code snippets) are sometimes all it takes.
Damian Hickey
@damianh
Jun 04 2015 12:45
I didn't want to opine on anything more than that extension point, at this point
agree