Changeset 1375:7463cec1af99


Ignore:
Timestamp:
10/17/09 11:39:18 (2 years ago)
Author:
niam
Branch:
default
Children:
1376:0c27d6fe47b2, 1377:907b0a6f6889
Message:

throw proper exceptions in pc::execution::manager

Location:
trunk/include/libdodo
Files:
1 edited
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/libdodo/pcExecutionManager.inline

    r1374 r1375  
    3131 
    3232#include <libdodo/pcExecutionManager.h> 
     33#include <libdodo/pcExecutionManagerEx.h> 
    3334#include <libdodo/types.h> 
    3435#include <libdodo/pcSyncSection.h> 
     
    9495 
    9596        if (job == handles.end()) 
    96                 throw; 
     97                throw exception::basic(exception::MODULE_PCEXECUTIONMANAGER, MANAGEREX_RUN, exception::ERRNO_LIBDODO, MANAGEREX_NOTFOUND, PCEXECUTIONMANAGEREX_NOTFOUND_STR, __LINE__, __FILE__); 
    9798 
    9899        job->second.run(); 
     
    110111 
    111112        if (job == handles.end()) 
    112                 throw; 
     113                throw exception::basic(exception::MODULE_PCEXECUTIONMANAGER, MANAGEREX_STOP, exception::ERRNO_LIBDODO, MANAGEREX_NOTFOUND, PCEXECUTIONMANAGEREX_NOTFOUND_STR, __LINE__, __FILE__); 
    113114 
    114115        job->second.stop(); 
     
    140141 
    141142        if (job == handles.end()) 
    142                 throw; 
     143                throw exception::basic(exception::MODULE_PCEXECUTIONMANAGER, MANAGEREX_WAIT, exception::ERRNO_LIBDODO, MANAGEREX_NOTFOUND, PCEXECUTIONMANAGEREX_NOTFOUND_STR, __LINE__, __FILE__); 
    143144 
    144145        return job->second.wait(); 
     
    170171 
    171172        if (job == handles.end()) 
    172                 throw; 
     173                throw exception::basic(exception::MODULE_PCEXECUTIONMANAGER, MANAGEREX_ISRUNNING, exception::ERRNO_LIBDODO, MANAGEREX_NOTFOUND, PCEXECUTIONMANAGEREX_NOTFOUND_STR, __LINE__, __FILE__); 
    173174 
    174175        return job->second.isRunning(); 
  • trunk/include/libdodo/pcExecutionManagerEx.h

    r1374 r1375  
    11/*************************************************************************** 
    2  *            pcExecutionThreadEx.h 
     2 *            pcExecutionManagerEx.h 
    33 * 
    44 *  Wed Oct 07 2009 
     
    2828 */ 
    2929 
    30 #ifndef _PCEXECUTIONTHREADEX_H_ 
    31 #define _PCEXECUTIONTHREADEX_H_ 1 
     30#ifndef _PCEXECUTIONMANAGEREX_H_ 
     31#define _PCEXECUTIONMANAGEREX_H_ 1 
    3232 
    3333#include <libdodo/directives.h> 
     
    4141                         * libdodo defined errors 
    4242                         */ 
    43                         enum threadExR { 
    44                                 THREADEX_ISALREADYRUNNING, 
    45                                 THREADEX_ISNOTLAUNCHED, 
    46                                 THREADEX_ISDETACHED, 
     43                        enum managerExR { 
     44                                MANAGEREX_NOTFOUND, 
    4745                        }; 
    4846 
     
    5048                         * libdodo defined errors explanation 
    5149                         */ 
    52 #define PCEXECUTIONTHREADEX_ISALREADYRUNNING_STR    "Thread is currently running" 
    53 #define PCEXECUTIONTHREADEX_ISNOTLAUNCHED_STR           "Thread is not launched" 
    54 #define PCEXECUTIONTHREADEX_ISDETACHED_STR          "Thread is detached" 
    55  
     50#define PCEXECUTIONMANAGEREX_NOTFOUND_STR    "Job was not found" 
    5651                        /** 
    5752                         * ID of function where exception was thrown 
    5853                         */ 
    59                         enum threadFunctionsID { 
    60                                 THREADEX_RUN, 
    61                                 THREADEX_WAIT, 
    62                                 THREADEX_STOP, 
    63                                 THREADEX_ISRUNNING, 
    64                                 THREADEX_CONSTRUCTOR, 
    65 #ifdef DL_EXT 
    66                                 THREADEX_MODULE, 
    67 #endif 
     54                        enum managerFunctionsID { 
     55                                MANAGEREX_RUN, 
     56                                MANAGEREX_WAIT, 
     57                                MANAGEREX_STOP, 
     58                                MANAGEREX_ISRUNNING, 
    6859                        }; 
    6960                }; 
Note: See TracChangeset for help on using the changeset viewer.