<commit_before>package org.pikater.web.vaadin.gui.client;

import org.pikater.web.vaadin.gui.client.managers.GWTKeyboardManager;
import org.pikater.web.vaadin.gui.client.managers.GWTLogger;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
import com.google.gwt.core.client.JavaScriptException;
import com.google.gwt.event.shared.UmbrellaException;
import com.google.gwt.user.client.Event;

public class AppEntryPoint implements EntryPoint
{
	@Override
	public void onModuleLoad()
	{
		/*
		 * Creates a special JS namespace, injects it into the window object and
		 * exports some JSNI functions that can be called from the server.
		 */
		// JSNI_SharedConfig.exportStaticMethods();

		/*
		 * Adds a keyboard listener that keeps track of what keys are currently
		 * pressed. The underlying code is called after an event is triggered
		 * and even before the browser processes it which allows for cancelling
		 * events.
		 */
		Event.addNativePreviewHandler(GWTKeyboardManager.getNativePreviewHandler());
		
		/*
		 * Send uncaught exceptions to the server:  
		 */
		GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler()
		{
			@Override
			public void onUncaughtException(Throwable e)
			{
				if((e instanceof UmbrellaException) || (e instanceof JavaScriptException))
				{
					// native exceptions usually contain no useful information => send a generic "warning" instead:
					GWTLogger.logUncaughtNativeClientException();
				}
				else
				{
					GWTLogger.logThrowable("Uncaught exception from the client", e);
				}
			}
		});
	}
}<commit_msg>Native client Exceptions shared to server now.<commit_after>package org.pikater.web.vaadin.gui.client;

import org.pikater.web.vaadin.gui.client.gwtmanagers.GWTKeyboardManager;
import org.pikater.web.vaadin.gui.client.gwtmanagers.GWTLogger;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.GWT.UncaughtExceptionHandler;
import com.google.gwt.core.client.JavaScriptException;
import com.google.gwt.event.shared.UmbrellaException;
import com.google.gwt.user.client.Event;

public class AppEntryPoint implements EntryPoint
{
	@Override
	public void onModuleLoad()
	{
		/*
		 * Creates a special JS namespace, injects it into the window object and
		 * exports some JSNI functions that can be called from the server.
		 */
		// JSNI_SharedConfig.exportStaticMethods();

		/*
		 * Adds a keyboard listener that keeps track of what keys are currently
		 * pressed. The underlying code is called after an event is triggered
		 * and even before the browser processes it which allows for cancelling
		 * events.
		 */
		Event.addNativePreviewHandler(GWTKeyboardManager.getNativePreviewHandler());
		
		/*
		 * Send uncaught exceptions to the server:  
		 */
		GWT.setUncaughtExceptionHandler(new UncaughtExceptionHandler()
		{
			@Override
			public void onUncaughtException(Throwable e)
			{
				if((e instanceof UmbrellaException) || (e instanceof JavaScriptException))
				{
					// native exceptions usually contain no useful information => send a generic "warning" instead:
					GWTLogger.logThrowable("Uncaught exception from the client", e);
					// GWTLogger.logUncaughtNativeClientException();
				}
				else
				{
					GWTLogger.logThrowable("Uncaught exception from the client", e);
				}
			}
		});
	}
}
{'fraction_non_alphanumeric': 0.08943089430894309, 'fraction_numerical': 0.0, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1084148', 'n_tokens_mistral': 1153, 'n_tokens_neox': 999, 'n_words': 264}