|
@@ -0,0 +1,50 @@
|
|
1
|
+DMDirc
|
|
2
|
+================================================================================
|
|
3
|
+
|
|
4
|
+DMDirc is an IRC client written in Java. It's cross-platform, hugely
|
|
5
|
+configurable, and is easily extensible with a robust plugins system.
|
|
6
|
+
|
|
7
|
+This repository contains the 'core' of the client. If you're interested in
|
|
8
|
+developing DMDirc or building it from scratch, you'd be much better off
|
|
9
|
+cloning the [meta](https://github.com/DMDirc/meta) repository, which contains
|
|
10
|
+the core, plugins, IRC library, etc. Detailed setup instructions are available
|
|
11
|
+there as well.
|
|
12
|
+
|
|
13
|
+Development information
|
|
14
|
+--------------------------------------------------------------------------------
|
|
15
|
+
|
|
16
|
+### Error handling
|
|
17
|
+
|
|
18
|
+DMDirc has a user interface for displaying details of errors to users. It also
|
|
19
|
+supports uploading of errors to the
|
|
20
|
+[DMDirc sentry instance](https://sentry.dmdirc.com/) if the user allows it (or
|
|
21
|
+manually clicks on send).
|
|
22
|
+
|
|
23
|
+Errors should be logged using a [Slf4j](http://www.slf4j.org/) logger, and
|
|
24
|
+marked with one markers defined in [LogUtils](https://github.com/DMDirc/DMDirc/blob/master/src/com/dmdirc/util/LogUtils.java).
|
|
25
|
+These markers allow developers to specify whether an error is an "Application"
|
|
26
|
+error (which will get reported and should ultimately be fixed), or a "User"
|
|
27
|
+error (which is due to a problem with the user's config, environment, etc),
|
|
28
|
+and also whether the error is fatal or not.
|
|
29
|
+
|
|
30
|
+A typical class that reports errors will look something like the following:
|
|
31
|
+```java
|
|
32
|
+import org.slf4j.Logger;
|
|
33
|
+import org.slf4j.LoggerFactory;
|
|
34
|
+
|
|
35
|
+import static com.dmdirc.util.LogUtils.APP_ERROR;
|
|
36
|
+
|
|
37
|
+public class MyClass {
|
|
38
|
+
|
|
39
|
+ private static final Logger LOG = LoggerFactory.getLogger(MyClass.class);
|
|
40
|
+
|
|
41
|
+ public void doSomething() {
|
|
42
|
+ try {
|
|
43
|
+ // Do something
|
|
44
|
+ } catch (SomeException ex) {
|
|
45
|
+ LOG.error(APP_ERROR, "Couldn't do something!", ex);
|
|
46
|
+ }
|
|
47
|
+ }
|
|
48
|
+
|
|
49
|
+}
|
|
50
|
+```
|