CRAFTERCMS-756: handled error cases
Merge pull request #197 from hlim/master

CRAFTERCMS-756: handled error cases