Skip to content

Improve surfacing of FileMaker error codes from within the library. #192

Description

@fuzzzerd

Is your feature request related to a problem? Please describe.

All Data API exceptions are simply thrown as Exception it would be nice to have a more specific exception and a way to respond accordingly if it is an HTTP level Data API exception vs. an internal to FileMaker error code that was wrapped in an HTTP500: https://help.claris.com/en/data-api-guide/content/error-responses.html

Describe the solution you'd like

try
{
    // data api call that returns a data api error
}
catch(FMDataException fmex)
{
    if(fmex.Code == FMData.ResponseCodes.RecordInUse)
    {
        // do something specific for this case
    }
    else
    {
        // handle the exception
    }
}

Describe alternatives you've considered

try
{
    // data api call that returns a data api error
}
catch(FMRecordInUseException inUseException)
{
    // do something specific for this case
}
catch(FMDataException fmex)
{
    // do something specific for this case
}

Additional context

I've used "Record In Use" as an example of a specific error code, but there are many and the system to support them should be similar: https://help.claris.com/en/pro-help/content/error-codes.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    data-apiPertaining to the Data API.enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions