Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DSResponse.getStatus == -11?

    hi,

    what means DSResponse.getStatus == -11? The file size for upload has been exceeded? correct?

    I find nothing about this rc in the javadoc:
    Code:
    com.smartgwt.client.rpc.RPCResponse
    public static final int	STATUS_FAILURE	-1
    public static final int	STATUS_LOGIN_INCORRECT	-5
    public static final int	STATUS_LOGIN_REQUIRED	-7
    public static final int	STATUS_LOGIN_SUCCESS	-8
    public static final int	STATUS_MAX_LOGIN_ATTEMPTS_EXCEEDED	-6
    public static final int	STATUS_SERVER_TIMEOUT	-100
    public static final int	STATUS_SUCCESS	0
    public static final int	STATUS_TRANSPORT_ERROR	-90
    public static final int	STATUS_VALIDATION_ERROR	-4
    best regards,
    timo

    #2
    It signals a generic failure where no more specified error has been given. The server logs as well as the "data" attribute of the response will have more specifics.

    Comment


      #3
      thanks but, it also occurs when an upload file is larger than maxFileSize (declared in ds.xml) and "setWillHandleError" is TRUE.

      Code:
      final DSRequest dsRequest = new DSRequest();
      HashMap<String, Object> params = new HashMap<String, Object>();
      
      params.put("singleUpload", true);
      dsRequest.setParams(params);
      dsRequest.setWillHandleError(true);
      
      valuesManager.saveData(new DSCallback() {
      
      
      			@Override
      			public void execute(DSResponse response, Object rawData, DSRequest request) {
      
      				// response.getStatus == -11
      				}
      
      }
      		}, dsRequest);
      DSRequest:
      Code:
      {
          dataSource:"DSXMLErrors", 
          operationType:"add", 
          componentId:"isc_DynamicForm_2", 
          data:{
              XMLFILE:"dddddd.xml", 
              LANGUAGE:"DE", 
              lastFileName:""
          }, 
          callback:{
              target:[DynamicForm ID:isc_DynamicForm_2], 
              methodName:"saveEditorReply"
          }, 
          willHandleError:true, 
          showPrompt:true, 
          prompt:"Saving form...", 
          oldValues:{
          }, 
          requestId:"DSXMLErrors$6274", 
          clientContext:{
          }, 
          fallbackToEval:false, 
          afterFlowCallback:"isc_DynamicForm_2.$49z(dsRequest, dsResponse, data)", 
          directSubmit:true, 
          submitForm:[DynamicForm ID:isc_DynamicForm_2], 
          editor:[DynamicForm ID:isc_DynamicForm_2], 
          lastClientEventThreadCode:"MUP8", 
          bypassCache:true
      }
      DSResponse:
      Code:
      [
          {
              invalidateCache:false, 
              isDSResponse:true, 
              maxFileSize:"5 MB", 
              queueStatus:-1, 
              status:-11, 
              uploadedFileName:"dddddd.xm", 
              uploadedFileSize:"11 MB", 
              data:null
          }
      ]
      If I set the setWillHandleError to false the field error message (max file size) is displayed correctly.

      is this a bug?

      Regards,
      timo

      Comment


        #4
        No, willHandleError means you will handle the error. So if you want a warning message shown, you will now have to show it.

        Comment


          #5
          ok thats clear. back to my question.
          DSResponse.getStatus == -11 stands for maxFileSize attempt?
          If that were not the case how can I distinguish the possible error. (maxFileSize vs. generic failure)

          Comment


            #6
            It does, yes. This is actually documented, but for some reason JavaDoc isn't showing it. We'll look into why.

            Comment

            Working...
            X