duvc-ctl 2.0.0
USB Video Class Camera Control Library
Loading...
Searching...
No Matches
error_handling.cpp File Reference

C ABI error handling and diagnostics implementation. More...

#include "duvc-ctl/c/api.h"
#include "duvc-ctl/core/result.h"
#include "duvc-ctl/utils/error_decoder.h"
#include "duvc-ctl/utils/logging.h"
#include <comdef.h>
#include <psapi.h>
#include <windows.h>
#include <atomic>
#include <cstring>
#include <iomanip>
#include <mutex>
#include <sstream>
#include <string>
#include <thread>
#include <unordered_map>
Include dependency graph for error_handling.cpp:

Go to the source code of this file.

Functions

int duvc_is_temporary_error (duvc_result_t result)
 
int duvc_is_user_error (duvc_result_t result)
 
duvc_result_t duvc_set_error_context (const char *operation, const char *device_info)
 
duvc_result_t duvc_get_error_statistics (char *buffer, size_t buffer_size, size_t *required_size)
 
void duvc_reset_error_statistics (void)
 
duvc_result_t duvc_suggest_error_resolution (duvc_result_t error_code, char *buffer, size_t buffer_size, size_t *required_size)
 
int duvc_should_retry_operation (duvc_result_t error_code)
 

Detailed Description

C ABI error handling and diagnostics implementation.

This file implements comprehensive error handling for the C ABI, including error code conversion, detailed error information management, and diagnostic utilities for troubleshooting camera control issues.

Definition in file error_handling.cpp.

Function Documentation

◆ duvc_get_error_statistics()

duvc_result_t duvc_get_error_statistics ( char * buffer,
size_t buffer_size,
size_t * required_size )

Definition at line 126 of file error_handling.cpp.

References DUVC_ERROR_BUFFER_TOO_SMALL, duvc_error_code_to_string(), and DUVC_SUCCESS.

Here is the call graph for this function:

◆ duvc_is_temporary_error()

int duvc_is_temporary_error ( duvc_result_t result)

◆ duvc_is_user_error()

int duvc_is_user_error ( duvc_result_t result)

◆ duvc_reset_error_statistics()

void duvc_reset_error_statistics ( void )

Definition at line 199 of file error_handling.cpp.

◆ duvc_set_error_context()

duvc_result_t duvc_set_error_context ( const char * operation,
const char * device_info )

◆ duvc_should_retry_operation()

◆ duvc_suggest_error_resolution()

duvc_result_t duvc_suggest_error_resolution ( duvc_result_t error_code,
char * buffer,
size_t buffer_size,
size_t * required_size )

Definition at line 211 of file error_handling.cpp.

References DUVC_ERROR_BUFFER_TOO_SMALL, duvc_error_code_to_string(), DUVC_ERROR_CONNECTION_FAILED, DUVC_ERROR_DEVICE_BUSY, DUVC_ERROR_DEVICE_NOT_FOUND, DUVC_ERROR_INVALID_VALUE, DUVC_ERROR_PERMISSION_DENIED, DUVC_ERROR_PROPERTY_NOT_SUPPORTED, DUVC_ERROR_SYSTEM_ERROR, and DUVC_SUCCESS.

Here is the call graph for this function: