/
Error Handling

Error Handling

Overview

The Freja eID Client throws three types of exceptions:

  • FrejaEidClientInternalException- Occurs when the client returns an internal error for:

    • internal validation of request failed,

    • SSL context initialisation failed (wrong password, a wrong absolute path or unsupported type of client keyStore or server certificate).

  • FrejaEidClientPollingException - Occurs when the polling timeout has been reached.

  • FrejaEidException - Occurs when the server returns an error.


Logging

Freja eID Client provides a logger you can include in your application. Once included, this logger will record all requests sent to Freja eID Relying Party API and the responses received from it. The root logger of the library is named ''com.verisec.frejaeid''.This client library uses slf4j library/facade. You may configure it with any of the popular Java logging frameworks, such as log4j, logback, JULI, etc. In case you are using log4j, below is an example of a simple log4j descriptor (log4j.xml configuration descriptor needs to be in the root of the classpath). With the given configuration, all logs end up in a console with the level TRACE.

<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> <appender name="console" class="org.apache.log4j.ConsoleAppender"> <param name="Target" value="System.out"/> <layout class="org.apache.log4j.EnhancedPatternLayout"> <param name="ConversionPattern" value="%d{ISO8601}{GMT+0} UTC %-5p %c{1} - [id=%X{id} user=%X{user} IP=%X{IP}] %m%n" /> </layout> </appender> <logger name="com.verisec.frejaeid"> <appender-ref ref="console"/> </logger> <root> <priority value="trace"></priority> </root> </log4j:configuration>

Go to:

  1. Quick Start Guide

  2. Initialising the Freja eID Client

  3. Authentication Client

  4. Signature Client

  5. Organisation ID Client

  6. Custom Identifier Client

  7. Error Handling

Related content

Authentication Service Client
Authentication Service Client
More like this
Freja eID Client - Developers' Guide
Freja eID Client - Developers' Guide
More like this
Implementation - Troubleshooting and Best Practices
Implementation - Troubleshooting and Best Practices
Read with this
Quick Start Guide
Quick Start Guide
More like this
Authentication Service
Authentication Service
Read with this
Information for Integrator Relying Parties
Information for Integrator Relying Parties
More like this