GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenAI::API::Error(3) User Contributed Perl Documentation OpenAI::API::Error(3)

OpenAI::API::Error - throwable error objects

    use OpenAI::API::Error;
    OpenAI::API::Error->throw(
        message  => 'Something went wrong',
        request  => $req,
        response => $res,
    );
    # elsewhere...
    try {
        my $response = $openai->$method(...);
    } catch ($e) {
        # Handle error
    }

The "OpenAI::API::Error" module provides an object-oriented exception mechanism for errors encountered while interacting with the OpenAI API. It extends the Throwable::Error class to include the optional HTTP::Request and HTTP::Response objects, allowing for better error reporting and debugging.

The "request" attribute holds the HTTP::Request object associated with the error.

The "response" attribute holds the HTTP::Response object associated with the error.

The "throw" method creates a new OpenAI::API::Error object with the provided message, request, and response attributes and throws it as an exception.

  • Throwable::Error
  • HTTP::Request
  • HTTP::Response
2023-03-25 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.