Skip to content

404 throws RuntimeException instead of RequestException #6

@aaronlp

Description

@aaronlp

Upon submitting a request to search for a list membership for a prospect, where no such membership exists I am finding it returns a 404, but rather than this being wrapped in a RequestException like the docs say, it is throwing a RunTimeException which makes it impossible to ascertain the status code as there is no way to get at the status code (even though it is there in the exception object)

PHP message: HGG\Pardot\Exception\RuntimeException Object                        
(                                                                                                                                                        
    [url:protected] => /api/listMembership/version/3/do/read                                                                                             
    [parameters:protected] => Array                                                                                                                      
        (                                                                                                                                                
            [api_key] => REDACTED                                                                                                
            [user_key] => REDACTED                                                                                               
            [format] => json                                                                                                                             
            [output] => full                                                                                                                             
            [prospect_id] => REDACTED                                                                                                                    
            [list_id] => REDACTED                                                                                                                           
        )                                                                                                                                                
                                                                                                                                                         
    [message:protected] => Client error response                                                                                                         
[status code] 404                                                                                                                                        
[reason phrase] Not Found                                                                                                                                
[url] https://pi.pardot.com/api/listMembership/version/3/do/read   

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions