crashanalysercmd/UI/CrashServer/CACommandLineEntryPoint.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Collections.Generic;
       
    19 using System.Text;
       
    20 using SymbianUtils.FileSystem;
       
    21 using SymbianUtils.FileSystem.Utilities;
       
    22 using CrashAnalyserServerExe.Engine;
       
    23 
       
    24 namespace CrashAnalyserServerExe
       
    25 {
       
    26     class EntryPoint
       
    27     {
       
    28         static int Main( string[] aArguments )
       
    29         {
       
    30             int error = CACmdLineException.KErrNone;
       
    31             //
       
    32             using ( FSLog log = new FSLog( true ) )
       
    33             {
       
    34                 try
       
    35                 {
       
    36                     FSUtilities.ClearTempPath();
       
    37                     //
       
    38                     CACommandLineUI commandLineUi = new CACommandLineUI( aArguments, log );
       
    39                     error = commandLineUi.Run();
       
    40                     //
       
    41                     if ( error != CACmdLineException.KErrNone )
       
    42                     {
       
    43                         SymbianUtils.SymDebug.SymDebugger.Break();
       
    44                     }
       
    45                 }
       
    46                 catch ( Exception e )
       
    47                 {
       
    48                     log.TraceAlways( "CrashAnalyserServerExe.Main() - EXCEPTION: " + e.Message );
       
    49                     log.TraceAlways( "CrashAnalyserServerExe.Main() - STACK:     " + e.StackTrace );
       
    50                     SymbianUtils.SymDebug.SymDebugger.Break();
       
    51                     error = -1;
       
    52                 }
       
    53                 //
       
    54                 if ( error != 0 )
       
    55                 {
       
    56                     log.TraceAlways( "CA completed with error: " + error );
       
    57                 }
       
    58             }
       
    59             //
       
    60             return error;
       
    61         }
       
    62     }
       
    63 }