Example usage for java.lang StackOverflowError toString

List of usage examples for java.lang StackOverflowError toString

Introduction

In this page you can find the example usage for java.lang StackOverflowError toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.kaaproject.kaa.server.common.dao.service.CtlServiceImpl.java

private CTLSchemaDto generateDefaultRecord(CTLSchemaDto unSavedSchema) {
    try {/*from   ww  w.  j av  a2s. c  o m*/
        String schemaBody = flatExportAsString(unSavedSchema);
        LOG.debug("Generating default record for flat schema: {}", schemaBody);
        RawSchema dataSchema = new RawSchema(schemaBody);
        DefaultRecordGenerationAlgorithm<RawData> dataProcessor = new DefaultRecordGenerationAlgorithmImpl<RawSchema, RawData>(
                dataSchema, new RawDataFactory());
        unSavedSchema.setDefaultRecord(dataProcessor.getRootData().getRawData());
        return unSavedSchema;
    } catch (StackOverflowError ex) {
        LOG.error(
                "Failed to generate default record. An endless recursion is detected. CTL schema " + "body: {}",
                unSavedSchema.getBody(), ex);
        throw new RuntimeException("Unable to generate default record. An endless recursion is " + "detected! "
                + "Please check non-optional references to nested types.");
    } catch (ConfigurationGenerationException | IOException | RuntimeException ex) {
        LOG.error("Failed to generate default record for CTL schema with body: {}", unSavedSchema.getBody(),
                ex);
        throw new RuntimeException("An unexpected exception occured: " + ex.toString());
    }
}