Error handling for BCM format is not working

Hello RWS Team!

We noticed that when we choose bcm as format, Language Cloud Platform is not handling exceptions and non 2xx error codes:

It's always like this if format == bcm:

Trace ID: 2a4d4d34-0c2f-4e25-9821-6ad11b9629c1_et_4bc7659c-97e1-11f0-aa84-ba70593baf0a

Name,Code,Value
processTask,FileProcessingException,Unknown error

We want to show clear error messages in the UI for our users, is it possible to add this logic?

Parents
  • Hi  ,

    Regarding messages that are display in the UI:

    • The platform called your extension’s /v1/bcmtranslate and received HTTP 400:
        ERROR - The POST request sent to https://…/v1/bcmtranslate failed with status code 400
    • Because the response body wasn’t a recognized error model, LC recorded:
        TaskError(name=processTask, code=FileProcessingException, value=Unknown error)

    Things to check:

    Use the blueprint exceptions and middleware (recommended)
    - If you’re using our app blueprint, add the exception middleware and throw our AppException types (they set both the HTTP status code and the JSON error body in the format LC expects). See existing exceptions managed from the Blueprint that you can use or extend here: https://github.com/RWS/language-cloud-extensibility/tree/cdc8552e3c22392adf8039d8f2378a69737b2e9e/blueprints/dotNetAppBlueprint/Rws.LC.AppBlueprint/Exceptions

    However, I'm also seeing a 'Invalid tenantId provided' message from the logs associated with yr trace-id.  This could indicate that the request/engine is being resolved against a tenant where the extension isn’t installed or no longer matches current config.

    Potential causes:

    • maybe the extension base URL changed
    • the engine/route belongs to a different organization/tenant
    • extension was removed/reinstalled and the engine/route references changed?

    Recommend:

    • Check that your add-on is installed in the tenant correctly and that the workflow template correctly represents the latest version.

    Patrick Andrew Hartnett | Developer Experience | Team Lead | RWS Group

Reply
  • Hi  ,

    Regarding messages that are display in the UI:

    • The platform called your extension’s /v1/bcmtranslate and received HTTP 400:
        ERROR - The POST request sent to https://…/v1/bcmtranslate failed with status code 400
    • Because the response body wasn’t a recognized error model, LC recorded:
        TaskError(name=processTask, code=FileProcessingException, value=Unknown error)

    Things to check:

    Use the blueprint exceptions and middleware (recommended)
    - If you’re using our app blueprint, add the exception middleware and throw our AppException types (they set both the HTTP status code and the JSON error body in the format LC expects). See existing exceptions managed from the Blueprint that you can use or extend here: https://github.com/RWS/language-cloud-extensibility/tree/cdc8552e3c22392adf8039d8f2378a69737b2e9e/blueprints/dotNetAppBlueprint/Rws.LC.AppBlueprint/Exceptions

    However, I'm also seeing a 'Invalid tenantId provided' message from the logs associated with yr trace-id.  This could indicate that the request/engine is being resolved against a tenant where the extension isn’t installed or no longer matches current config.

    Potential causes:

    • maybe the extension base URL changed
    • the engine/route belongs to a different organization/tenant
    • extension was removed/reinstalled and the engine/route references changed?

    Recommend:

    • Check that your add-on is installed in the tenant correctly and that the workflow template correctly represents the latest version.

    Patrick Andrew Hartnett | Developer Experience | Team Lead | RWS Group

Children
No Data