UmyaSpreadsheet.ErrorHandling (umya_spreadsheet_ex v0.7.0)

View Source

Helper functions for standardizing error handling across the UmyaSpreadsheet library.

Summary

Functions

Standardizes success return values, ensuring they follow the {:ok, value} pattern.

Standardizes result format for NIF functions that might return mixed formats. This is the main function to use for most function return value processing.

Unwraps nested error tuples to ensure a standardized error format. This helps with fixing the nested error tuples like {:error, {:error, reason}} to {:error, reason}

Functions

standardize_ok_result(value)

Standardizes success return values, ensuring they follow the {:ok, value} pattern.

standardize_result(error)

Standardizes result format for NIF functions that might return mixed formats. This is the main function to use for most function return value processing.

unwrap_error(other)

Unwraps nested error tuples to ensure a standardized error format. This helps with fixing the nested error tuples like {:error, {:error, reason}} to {:error, reason}