DomError


public abstract class DomError
Known direct subclasses

While CredentialManager flows use Exceptions, in some cases, the exceptions are focused on a range of widely used, uncommonly named 'errors'. This class should be used to generate subclass errors, packaged under an Exception superclass. Please see the example below for usage details.

For this codebase, we use this widely with errors from the public key credential and general web error specs, shown here.

In this example, we create a wrapper exception named CreatePublicKeyCredentialDomException. This contains a constructor that accepts a DomError. We then employ various sub classes to the DomError for individual error types, such as AbortError.

class AbortError : DomError(type_var) { ... }

Then it is expected that when abort errors show up in code, one can create the wrapper exception with the designed DomError subclass.

// ... (logic checking for abort error) ...
val exception = CreatePublicKeyCredentialDomException(AbortError(), e.getMessage())
// ... (logic using exception to throw or pass in callback) ...

This utilization may vary by use case.

Summary

Public constructors

DomError

Added in 1.2.0
public DomError(@NonNull String type)