Subversion Repositories eFlore/Applications.coel

Rev

Rev 1509 | Rev 1784 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1509 Rev 1780
Line 1... Line 1...
1
package org.tela_botanica.client;
1
package org.tela_botanica.client;
Line 2... Line 2...
2
 
2
 
3
import com.extjs.gxt.ui.client.GXT;
3
import com.extjs.gxt.ui.client.GXT;
-
 
4
import com.google.gwt.core.client.EntryPoint;
-
 
5
import com.google.gwt.core.client.GWT;
Line 4... Line 6...
4
import com.google.gwt.core.client.EntryPoint;
6
import com.google.gwt.user.client.Window;
Line 5... Line 7...
5
 
7
 
-
 
8
public class Coel implements EntryPoint {
-
 
9
 
-
 
10
	public void onModuleLoad() {
-
 
11
		
-
 
12
		// A décommenter + compiler en detailed dans le cas d'une erreur
-
 
13
		// survernant uniquement sur le serveur
-
 
14
		GWT.setUncaughtExceptionHandler(null);
-
 
15
		GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {	
-
 
16
			@Override
-
 
17
			public void onUncaughtException(Throwable e) {
-
 
18
					Window.alert("uncaught: " + e.getMessage());
-
 
19
					String s = buildStackTrace(e, "RuntimeException:\n");
-
 
20
					Window.alert(s);
-
 
21
					e.printStackTrace();
6
public class Coel implements EntryPoint {
22
			}
7
 
23
		});
Line 8... Line 24...
8
	public void onModuleLoad() {
24
		
9
		// Fermeture du panneau de chargement de l'appli
25
		// Fermeture du panneau de chargement de l'appli
Line 16... Line 32...
16
		if (Mediateur.DEBUG) {
32
		if (Mediateur.DEBUG) {
17
			System.out.println("");
33
			System.out.println("");
18
			System.out.println("-------------------------------------------------------------------");
34
			System.out.println("-------------------------------------------------------------------");
19
			System.out.println("");
35
			System.out.println("");
20
		}
36
		}
21
		
-
 
22
		
-
 
23
	}
37
	}
-
 
38
	
-
 
39
	private String buildStackTrace(Throwable t, String log) {
-
 
40
	    if (t != null) {
-
 
41
		     log += t.getClass().toString();
-
 
42
		     log += t.getMessage();
-
 
43
		     //
-
 
44
		     StackTraceElement[] stackTrace = t.getStackTrace();
-
 
45
		     if (stackTrace != null) {
-
 
46
		    	 StringBuffer trace = new StringBuffer();
-
 
47
		    
-
 
48
			     for (int i = 0; i < stackTrace.length; i++) {
-
 
49
			    	 trace.append(stackTrace[i].getClassName() + "." + stackTrace[i].getMethodName() + "("
-
 
50
			    			 + stackTrace[i].getFileName() + ":" + stackTrace[i].getLineNumber());
-
 
51
			     }
-
 
52
		    
-
 
53
			     log += trace.toString();
-
 
54
		     }
-
 
55
		     //
-
 
56
		     Throwable cause = t.getCause();
-
 
57
		     if (cause != null && cause != t) {
-
 
58
		    	 log += buildStackTrace(cause, "CausedBy:\n");
-
 
59
		     }
-
 
60
	    }
-
 
61
	    return log;
-
 
62
	}
-
 
63
 
-
 
64
	public static native void  LogVersFirebug(String s) /*-{
-
 
65
		if (!!($wnd.console && $wnd.console.log)) {
-
 
66
			console.log(s);
-
 
67
		}
-
 
68
	}-*/;
24
}
69
}
25
70