Refactor switch to Dic
Add error property to NLORMException