module AI::Provider::Errors

Defined in:

ai/provider/errors/get_error_message.cr

Class Method Summary

Class Method Detail

def self.get_error_message(error) : String #

Extracts an error message from various input types.

Returns:

  • "unknown error" for nil
  • The string itself for String inputs
  • The message property for Exception inputs
  • JSON serialization for all other types

[View source]