'Catch exception' extension on Task class
I have code like this: try { await myFunc(); } catch (MyException ex) { switch (ex.Code) { case 1: … break; case 2: … break; … } } And was wondering is it possible to make all that look something like this: … { await myFunc().HandleMyExeptions(OnMyException); } private void OnMyException(int exCode) { switch (ex.Code) {… Read More 'Catch exception' extension on Task class