forked from florentbr/SeleniumBasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeleniumError.cs
More file actions
41 lines (31 loc) · 1.14 KB
/
SeleniumError.cs
File metadata and controls
41 lines (31 loc) · 1.14 KB
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
using Selenium;
namespace Selenium {
/// <summary>
/// Selenium base error class.
/// </summary>
public class SeleniumError : SeleniumException {
protected const int FACILITY_CONTROL_ERROR = unchecked((int)0xA00A0000);
/// <summary></summary>
public Dictionary ResponseData { get; internal set; }
private string _message;
internal SeleniumError(string message, params object[] args)
: this(args.Length > 0 ? string.Format(message, args) : message, 0) {
}
internal SeleniumError(int code, string message, params object[] args)
: this(args.Length > 0 ? string.Format(message, args) : message, code) {
}
internal SeleniumError(string message, int code = 0) {
_message = message;
base.HResult = FACILITY_CONTROL_ERROR | code;
}
/// <summary>
/// Exception message
/// </summary>
public override string Message {
get {
var typename = this.GetType().Name;
return string.Format("{0}\n{1}", typename, _message);
}
}
}
}