piwebasync/api/models.py
def handle_web_exception(cls, values: Dict[str, JSONType]) -> Dict[str, JSONType]:
        """
        Handles WebException property in response body (if present).
        See link for error handling and WebException property
        https://docs.osisoft.com/bundle/pi-web-api-reference/page/help/topics/error-handling.html
        """
        # handle WebException property, update status_code and errors fields
        web_exception = values.get('WebException')
        if web_exception is not None:
            errors = values.get('Errors')
            if not errors:
                errors = web_exception["Errors"]
            else:
                errors.extend(web_exception["Errors"])
            status_code = web_exception['StatusCode']
            values.update(
                {
                    'Errors': errors,
                    'status_code': status_code
                }
            )
        return values

        Handles WebException property in response body (if present).
        See link for error handling and WebException property
        https://docs.osisoft.com/bundle/pi-web-api-reference/page/help/topics/error-handling.html
        
Handles WebException property in response body (if present).
Handles WebException property in response body ( if present ) .
def handle_web_exception(cls, values: Dict[str, JSONType]) -> Dict[str, JSONType]:
        web_exception = values.get('WebException')
        if web_exception is not None:
            errors = values.get('Errors')
            if not errors:
                errors = web_exception["Errors"]
            else:
                errors.extend(web_exception["Errors"])
            status_code = web_exception['StatusCode']
            values.update(
                {
                    'Errors': errors,
                    'status_code': status_code
                }
            )
        return values
def handle_web_exception ( cls , values : Dict [ str , JSONType ] ) -> Dict [ str , JSONType ] : web_exception = values . get ( 'WebException' ) if web_exception is not None : errors = values . get ( 'Errors' ) if not errors : errors = web_exception [ "Errors" ] else : errors . extend ( web_exception [ "Errors" ] ) status_code = web_exception [ 'StatusCode' ] values . update ( { 'Errors' : errors , 'status_code' : status_code } ) return values
Handles WebException property in response body (if present).
Handles WebException property in response body ( if present ) .
"""
        Handles WebException property in response body (if present).
        See link for error handling and WebException property
        https://docs.osisoft.com/bundle/pi-web-api-reference/page/help/topics/error-handling.html
        """ # handle WebException property, update status_code and errors fields

cls
values
Dict[str, JSONType]