From 08aadf24f225b4092e9624a6b2970a1e7b8d1615 Mon Sep 17 00:00:00 2001 From: Oleksandr Lazarenko Date: Mon, 22 Jun 2026 19:09:01 +0200 Subject: [PATCH] FIX: Set SuppressProcessExceptions to true in web example configs (#276) --- .../cloud/gettingstarted_web/app.py | 4 ++++ .../cloud/useragentclienthints_web/app.py | 4 ++++ .../onpremise/gettingstarted_web/app.py | 4 ++++ .../onpremise/gettingstarted_web/config.json | 5 ++++- .../onpremise/useragentclienthints_web/app.py | 4 ++++ .../onpremise/useragentclienthints_web/config.json | 5 ++++- 6 files changed, 24 insertions(+), 2 deletions(-) diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py index 664540b17..b92e65359 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/gettingstarted_web/app.py @@ -103,6 +103,10 @@ def build(self, resource_key, logger): pipeline_settings = { "resource_key": resource_key, "javascript_builder_settings": javascript_builder_settings, + # Set to True so a device-detection failure degrades gracefully instead of + # returning a 500 for every request. Use False while developing to surface + # mistakes loudly. Errors are still recorded on flowdata.errors / the logger. + "suppress_process_exceptions": True, } # If a cloud endpoint is set in the environment, point the pipeline at it. cloud_endpoint = ExampleUtils.get_cloud_endpoint() diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/useragentclienthints_web/app.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/useragentclienthints_web/app.py index ac8c2373a..d594153cd 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/useragentclienthints_web/app.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/cloud/useragentclienthints_web/app.py @@ -64,6 +64,10 @@ def build(self, resource_key, logger): # header use the SetHeaderBrowserAccept-CH property. pipeline_settings = { "resource_key": resource_key, + # Set to True so a device-detection failure degrades gracefully instead of + # returning a 500 for every request. Use False while developing to surface + # mistakes loudly. Errors are still recorded on flowdata.errors / the logger. + "suppress_process_exceptions": True, } # If a cloud endpoint is set in the environment, point the pipeline at it. cloud_endpoint = ExampleUtils.get_cloud_endpoint() diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py index 7b8fe826d..d5a4f6a23 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/app.py @@ -91,6 +91,10 @@ class GettingStartedWeb(): def build(self, config, logger): # Here we add some callback settings for the page to make a request with extra evidence from the client side, in this case the Flask /json route we will make below + # 'suppress_process_exceptions' is set to True in config.json + # (PipelineOptions.BuildParameters) so a device-detection failure degrades + # gracefully instead of returning a 500 for every request. Use False while + # developing to surface mistakes loudly. GettingStartedWeb.pipeline = PipelineBuilder().add_logger(logger).build_from_configuration(config) return self diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/config.json b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/config.json index d5cf49846..b355a2e48 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/config.json +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/gettingstarted_web/config.json @@ -42,6 +42,9 @@ "header_blacklist": [] } } - ] + ], + "BuildParameters": { + "suppress_process_exceptions": true + } } } \ No newline at end of file diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py index fe00208cc..9c3630cf9 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/app.py @@ -65,6 +65,10 @@ class UserAgentClientHintsWeb(): app = Flask(__name__) def build(self, config, logger): + # 'suppress_process_exceptions' is set to True in config.json + # (PipelineOptions.BuildParameters) so a device-detection failure degrades + # gracefully instead of returning a 500 for every request. Use False while + # developing to surface mistakes loudly. UserAgentClientHintsWeb.pipeline = PipelineBuilder().add_logger(logger).build_from_configuration(config) return self diff --git a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/config.json b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/config.json index d5cf49846..b355a2e48 100644 --- a/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/config.json +++ b/fiftyone_devicedetection_examples/src/fiftyone_devicedetection_examples/onpremise/useragentclienthints_web/config.json @@ -42,6 +42,9 @@ "header_blacklist": [] } } - ] + ], + "BuildParameters": { + "suppress_process_exceptions": true + } } } \ No newline at end of file