-
Notifications
You must be signed in to change notification settings - Fork 0
/
BurnerException.cpp
53 lines (48 loc) · 1.23 KB
/
BurnerException.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* BurnerException.cpp
* DVDBurner
*
* Copyright 2011 PrimoSoftware Corp. All rights reserved.
*
*/
#include "BurnerException.h"
BurnerException BurnerException::CreateDataDiscException(DataDisc* dataDisc, Device* device)
{
if (NULL != dataDisc)
{
const ErrorInfo* info = dataDisc->error();
switch(info->facility())
{
case ErrorFacility::Device:
return CreateDeviceException(device);
case ErrorFacility::SystemPosix:
return CreateSystemErrorException(info->code(), info->facility());
default:
return DataDiscException(dataDisc);
}
}
return BurnerException();
}
BurnerException BurnerException::CreateDeviceException(Device* device)
{
if (NULL != device)
{
const ErrorInfo* info = device->error();
switch(info->facility())
{
case ErrorFacility::SystemPosix:
return CreateSystemErrorException(info->code(), info->facility());
default:
return BurnerDeviceException(device);
}
}
return BurnerException();
}
BurnerException BurnerException::CreateSystemErrorException(int errorCode, ErrorFacility::Enum facility)
{
return BurnerSystemErrorException(errorCode, facility);
}
BurnerException BurnerException::CreateBurnerException(int errorCode)
{
return BurnerException(errorCode);
}