Result handling | .NET MAUI Document Scanner
Starting with SDK version 8.0.0, new classes, Result and Result<T>, have been introduced to represent operation results without throwing exceptions by default.
Result represents an outcome without a return value, while Result<T> represents an outcome that may contain a value of generic type T.
On success, IsSuccess is true and (for Result<T>) the returned data is available via Value (or ValueOrNull).
On failure, IsSuccess is false and the underlying platform/native error is exposed via Error.
The SDK may mark the result as canceled via IsCanceled when the operation is canceled by closing a RTU UI screen.
Accessing Result<T>.Value will return the value when successful; otherwise it throws the stored Error exception.
The Error property can be mapped to a specific exception type from the list below:
UnknownException
InvalidLicenseException
NullReferenceException
InvalidArgumentException
InvalidImageRefError
ComponentUnavailableError
IllegalStateException
IOException
InvalidDataException
OperationCanceledException
OutOfMemoryException
TimeoutException
InvalidOperationException
What does this mean in practice? It means you can now handle results in the way that best fits your project. For example:
loading...
loading...
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get free trial licenseScanbot SDK is part of the Apryse SDK product family
A mobile scan is just the start. With Apryse SDKs, you can expand mobile workflows into full cross‑platform document processing. Whether you need to edit PDFs, add secure digital signatures, or use a fast, customizable document viewer and editor, Apryse gives you the tools to build powerful features quickly.
Learn more
