CMS-4321 Improve exceptions for ScriptService.