<commit_before>package org.mondo.collaboration.security.lens.offline.cli;

import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.mondo.collaboration.security.lens.bx.AbortReason.DenialReason;
import org.mondo.collaboration.security.lens.bx.offline.OfflineLensGlue;

public class OfflineLensApplication implements IApplication {


	@Override
	public Object start(IApplicationContext context) throws Exception {
		String[] argArray = (String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS);

		final DenialReason denialReason = OfflineLensGlue.invokeOfflineLens(argArray);
        if (null == denialReason) {
		    return IApplication.EXIT_OK;
        } else {
            System.err.println(denialReason.prettyPrintProblem());
		    return -1;
        }
	}


	@Override
	public void stop() {
		// TODO Auto-generated method stub

	}

}<commit_msg>Lens CLI - better exception handling<commit_after>package org.mondo.collaboration.security.lens.offline.cli;

import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.mondo.collaboration.security.lens.bx.AbortReason.DenialReason;
import org.mondo.collaboration.security.lens.bx.offline.OfflineLensGlue;

public class OfflineLensApplication implements IApplication {


	@Override
	public Object start(IApplicationContext context) throws Exception {
		String[] argArray = (String[]) context.getArguments().get(IApplicationContext.APPLICATION_ARGS);

		try {
    		final DenialReason denialReason = OfflineLensGlue.invokeOfflineLens(argArray);
            if (null == denialReason) {
    		    return IApplication.EXIT_OK;
            } else {
                System.err.println(denialReason.prettyPrintProblem());
    		    return -1;
            }
		} catch (Exception ex) {
            System.err.println("Aborted due to internal error (see server log for details) - " + ex.getMessage());
            return -1;
		}
	}


	@Override
	public void stop() {
		// TODO Auto-generated method stub

	}

}
{'fraction_non_alphanumeric': 0.09912959381044488, 'fraction_numerical': 0.0014506769825918763, 'mean_word_length': 3.7893518518518516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5223458', 'n_tokens_mistral': 655, 'n_tokens_neox': 608, 'n_words': 115}