package Ġcom . github . sk ied row ski . tools . j ee . rest . exception mapper Ċ Ċ import Ġjavax . ws . rs . core . Response Ċ import Ġjavax . ws . rs . ext . Exception Mapper Ċ Ċ object ĠE JB Exception Mapper Registration Ġ{ ĊĠĠĠ Ġprivate Ġval Ġregistered Exception Map pers Ġ= Ġmutable Map Of < Class < out ĠThrowable >, ĠException Mapper < out ĠThrowable >>() ĊĊĠĠĠ Ġfun Ġregister ( exc Class : ĠClass < out ĠThrowable >, Ġexc Mapper : ĠException Mapper < out ĠThrowable >) Ġ{ ĊĠĠĠĠĠĠĠ Ġregistered Exception Map pers [ exc Class ] Ġ= Ġexc Mapper ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġ< T Ġ: ĠThrowable > Ġbuild Response ( exc Class : ĠClass < T >, Ġex : ĠT ): ĠResponse ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ// TODO Ġunderstand Ġtype Ġprojection s ĊĠĠĠĠĠĠĠ Ġval Ġexception Mapper Ġ= Ġregistered Exception Map pers [ exc Class ] Ġas ĠException Mapper < Throwable >? ĊĠĠĠĠĠĠĠ Ġreturn Ġexception Mapper ?. to Response ( ex ) ĊĠĠĠ Ġ} Ċ }