Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
99 lines (92 loc) · 2.49 KB

File metadata and controls

99 lines (92 loc) · 2.49 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
* Copyright (c) 2001, 2004, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package java.util.logging;
/**
* ErrorManager objects can be attached to Handlers to process
* any error that occurs on a Handler during Logging.
* <p>
* When processing logging output, if a Handler encounters problems
* then rather than throwing an Exception back to the issuer of
* the logging call (who is unlikely to be interested) the Handler
* should call its associated ErrorManager.
*/
public class ErrorManager {
private boolean reported = false;
/*
* We declare standard error codes for important categories of errors.
*/
/**
* GENERIC_FAILURE is used for failure that don't fit
* into one of the other categories.
*/
public final static int GENERIC_FAILURE = 0;
/**
* WRITE_FAILURE is used when a write to an output stream fails.
*/
public final static int WRITE_FAILURE = 1;
/**
* FLUSH_FAILURE is used when a flush to an output stream fails.
*/
public final static int FLUSH_FAILURE = 2;
/**
* CLOSE_FAILURE is used when a close of an output stream fails.
*/
public final static int CLOSE_FAILURE = 3;
/**
* OPEN_FAILURE is used when an open of an output stream fails.
*/
public final static int OPEN_FAILURE = 4;
/**
* FORMAT_FAILURE is used when formatting fails for any reason.
*/
public final static int FORMAT_FAILURE = 5;
/**
* The error method is called when a Handler failure occurs.
* <p>
* This method may be overridden in subclasses. The default
* behavior in this base class is that the first call is
* reported to System.err, and subsequent calls are ignored.
*
* @param msg a descriptive string (may be null)
* @param ex an exception (may be null)
* @param code an error code defined in ErrorManager
*/
public synchronized void error(String msg, Exception ex, int code) {
if (reported) {
// We only report the first error, to avoid clogging
// the screen.
return;
}
reported = true;
String text = "java.util.logging.ErrorManager: " + code;
if (msg != null) {
text = text + ": " + msg;
}
System.err.println(text);
if (ex != null) {
ex.printStackTrace();
}
}
}
Morty Proxy This is a proxified and sanitized view of the page, visit original site.