ReaderServiceException
com.rvi.application.exception.ReaderServiceException · Class · SocialCard 1.0.3
Report reader discovery, connection and card-operation failures.
When to use it
Section titled “When to use it”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.
Java example
Section titled “Java example”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.
How it works
Section titled “How it works”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.
Related API
Section titled “Related API”ReaderService · ReaderRepository · CardCapacityException · TlvException