Error Reporting and Handling

Error Codes

The CBFS Storage component APIs communicate errors using the error codes defined in their Error Codes pages (available for each component). The CBDrive and CBDisk components also communicate errors using OS-specific error codes; for example, on Windows they use Win32 error codes defined in WinError.h, which is part of the Windows Platform SDK.

Reporting Errors to the Component from Event Handlers

If the event has a ResultCode parameter, the event handler can use it to return the result code of the operation to the component. The ResultCode parameter is set to 0 by default, which indicates the operation was successful.

If the event handler panics, the component will recover from an error and fire the OnError event.

In some events, the OS doesn't expect the error code to be returned and either the component or the OS ignores the returned error code. Please, refer to the description of a particular event for more information.

How to Handle Errors Reported by the Component

If an error occurs, the functions of the component will return an error structure. The code field of the structure will contain an error code, and the message field will contain an error message (if available).

Extended Logging (Driver-based Components Only)

Some component methods in CBFS Storage are capable of writing extended information about reported errors to the Windows event logs, which can be viewed using the system's eventvwr.exe tool. The user mode part of the component writes to the "Windows Logs \ Application" folder, while the kernel mode part writes to the "Windows Logs \ System" folder.

The information written in the extended logs is meaningful to the Callback Technologies development team, but not to end-users, so extended logging is disabled by default. If issues occur during the installation of the CBFS Storage system drivers, or while using the component, please do the following:

  1. Enable extended logging (see below).
  2. Replicate the issue.
  3. Using Event Viewer (eventvwr.exe), export the event log entries from the locations mentioned above in native format (please restrict the scope of the export to just those entries related to CBFS Storage).
  4. Submit an issue report that includes the exported file.

There are two ways to toggle extended logging for a component:

  1. By toggling the component's LoggingEnabled configuration setting.
  2. By adding a DWORD-typed value named Enabled to the HKEY_LOCAL_MACHINE\SOFTWARE\CallbackTechnologies\CBDrive\EventLog registry key and setting it to 0 (disabled) or 1 (enabled). If this registry key, one of its parents, or the value itself does not exist, please create it manually.

The system must be rebooted anytime extended logging is enabled or disabled to make the changes take effect.

Copyright (c) 2021 Callback Technologies, Inc. - All rights reserved.
CBFS Storage 2020 Go Edition - Version 20.0 [Build 8031]