MDL-37654 core_course: translated exceptions so static error code is returned for debugging in web services