### Question:
ScriptExceptionMappingHandler implements ExceptionMappingHandler<ScriptException, ResourceException> { @Override public ResourceException handleError(Context context, String debug, Request request, ScriptException error) { return ResourceException.getException(getResourceErrorCode(error.getScriptErrorCode()), getLocalizedMessage(context, error), error); }  @Override ResourceException handleError(Context context, String debug, Request request, ScriptException error); @Override ResourceException handleError(String debug, Request request, ScriptException error); @Override ResourceException handleError(Context context, Request request, ScriptException error); @Override ResourceException handleError(Request request, ScriptException error); @Override ResourceException handleError(ScriptException error);  }### Answer:
@Test public void shouldHandleAllScriptExceptionCodes() throws Exception { for (ScriptErrorCode errorCode : ScriptErrorCode.values()) { ResourceException re = mappingHandler.handleError(new ScriptException(errorCode)); assertNotNull(re); assertNotNull(re.getMessage()); assertTrue(isClientError(re.getCode()) || re.isServerError()); } }
@Test public void shouldTranslateMessageToAcceptLanguage() throws Exception { final Context serverContext = getHttpServerContext("te"); for (ScriptErrorCode errorCode : ScriptErrorCode.values()) { ResourceException re = mappingHandler.handleError(serverContext, null, new ScriptException(errorCode)); assertNotNull(re); } }