Changeset 387


Ignore:
Timestamp:
Jan 10, 2013, 12:15:05 PM (12 years ago)
Author:
djay
Message:

Return exceptionReport when the session file cannot be red or written.

Location:
trunk/zoo-project/zoo-kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal.c

    r386 r387  
    18491849      tmpPath=getMapFromMaps(m,"main","tmpPath");
    18501850    sprintf(session_file_path,"%s/sess_%s.cfg",tmpPath->value,sessId);
    1851     dumpMapsToFile(tmpSess,session_file_path);
     1851    FILE* teste=fopen(session_file_path,"w");
     1852    if(teste==NULL){
     1853      char tmpMsg[1024];
     1854      sprintf(tmpMsg,_("Unable to create the file : \"%s\" for storing the session maps."),session_file_path);
     1855      map * errormap = createMap("text",tmpMsg);
     1856      addToMap(errormap,"code", "InternalError");
     1857      printExceptionReportResponse(m,errormap);
     1858      freeMap(&errormap);
     1859      free(errormap);
     1860      return;
     1861    }
     1862    else{
     1863      fclose(teste);
     1864      dumpMapsToFile(tmpSess,session_file_path);
     1865    }
    18521866  }
    18531867 
     
    19111925        if(ofile==NULL){
    19121926          char tmpMsg[1024];
    1913           sprintf(tmpMsg,_("Unable to create the file : \"%s\" for storing the final result."),tmpI->name);
     1927          sprintf(tmpMsg,_("Unable to create the file : \"%s\" for storing the %s final result."),file_name,tmpI->name);
    19141928          map * errormap = createMap("text",tmpMsg);
    19151929          addToMap(errormap,"code", "InternalError");
     
    19301944        }
    19311945        addToMap(tmpI->content,"Reference",file_url);
    1932         if(hasExt!=true){
     1946        if(!hasExt){
    19331947          freeMap(&ext);
    19341948          free(ext);
  • trunk/zoo-project/zoo-kernel/zoo_service_loader.c

    r385 r387  
    21372137      addMapsToMaps(&m,tmpSess);
    21382138      freeMaps(&tmpSess);
     2139    }else{
     2140      errorException(m, _("Unable to read your session file."), "InternalError");
     2141      freeMaps(&tmpSess);
     2142      freeService(&s1);
     2143      free(s1);
     2144      freeMaps(&m);
     2145      free(m);
     2146      freeMaps(&request_input_real_format);
     2147      free(request_input_real_format);
     2148      freeMaps(&request_output_real_format);
     2149      free(request_output_real_format);
     2150      free(REQUEST);
     2151      free(SERVICE_URL);
     2152      return 1;
    21392153    }
    21402154    free(tmpSess);
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png