Skip to content

ReaderServiceException

com.rvi.application.exception.ReaderServiceException · Class · SocialCard 1.0.3

Report reader discovery, connection and card-operation failures.

Catch it around discovery or card I/O to show actionable feedback. At connection time, check that the reader is available and a tag is in place. On a write error, read the tag again before reporting success or deciding to retry.

try (final IReaderService reader = ReaderService.create()) {
reader.connect();
System.out.println(reader.readURIs());
} catch (final ReaderServiceException failure) {
System.err.println("Reader operation failed.");
System.err.println(failure.getMessage());
}
Java imports
import com.rvi.application.exception.ReaderServiceException;
import com.rvi.service.IReaderService;
import com.rvi.service.ReaderService;

Invalid tag data can also surface as a format exception such as TlvException or NDefMessageException. Handle those separately when the application needs to explain the format failure.

The service and repository use this unchecked exception for conditions such as missing devices, inaccessible memory and verification failure. Some failures wrap a lower-level cause. CardCapacityException is a more specific subtype and can be caught first.

ReaderService · ReaderRepository · CardCapacityException · TlvException

Method signatures in the Javadoc · All API types