Gemalto is now part of the Thales Group, find out more.

You are here

How can I customize | Thales IoT Developer Community


November 6, 2014 - 12:47am, 1471 views


I am working with TC65.My application performs certain calculations. In order to do the final calculation the application request a data from a Servlet using http post request.
I have a method to create a backup file in memory flash in order to copy the servlet data to read it then if there is a GSM problem connection.
 If I disconnect the antenna of the modem or there is a problem with the GMS network I receive an exception error instead of the expected data from the backup file.
What is your suggestion?.Should I need to customize the error exception to run the method I have to read the data from the backup file? How Can I do it?
I have a method readFromFile() in order to return the value if there is a problem with the network but I can't avoid the exception error.


 public int processServerResponse(HttpConnection http,InputStream iStream)
   throws IOException{
   try {
         }catch ( Exception ex ){
            System.out.println( "Http : ex : " + ex.getClass() + " : " + ex.getMessage() );
        return result;

//receiving data from Servlet in order to do the final calculation
           try {
                   } catch (IOException ex) {
                   } catch (InterruptedException ex) {
           // do the final calculation
         FinalValue=(double)(value *result)/12;
           System.out.println("Tarifa a pagar:" + FinalValue);