code: private WorkCompletedException contextSetupFailure(Object context, String errorCode, Throwable cause) {
  
          if (context instanceof WorkContextLifecycleListener)
              ((WorkContextLifecycleListener) context).contextSetupFailed(errorCode);
  
          String message = null;
  
          if (WorkContextErrorCodes.DUPLICATE_CONTEXTS.equals(errorCode))
              message = Utils.getMessage("J2CA8624.work.context.duplicate", bootstrapContext.resourceAdapterID, context.getClass().getName());
          else if (WorkContextErrorCodes.UNSUPPORTED_CONTEXT_TYPE.equals(errorCode))
              message = Utils.getMessage("J2CA8625.work.context.unavailable", bootstrapContext.resourceAdapterID, context.getClass().getName());
          else if (cause != null)
              message = cause.getMessage();
  
          WorkCompletedException wcex = new WorkCompletedException(message, errorCode);
          if (cause != null)
              wcex.initCause(cause);
          return wcex;
      }
docs: Handle a work context setup failure.
  
  @param workContext the work context.
  @param errorCode error code from javax.resource.spi.work.WorkContextErrorCodes
  @param cause Throwable to chain as the cause. Can be null.
  @return WorkCompletedException to raise the the invoker.