51Degrees / pipeline-dotnet

51Degrees Pipeline for .NET
Other
0 stars 2 forks source link

javascript/json endpoints fail when cloud.51degrees.com is unreachable #75

Closed justadreamer closed 11 months ago

justadreamer commented 11 months ago

Background

There are several situations:

  1. cloud.51degrees.com is unreachable (simulated by specifying 127.0.0.1 cloud.51degrees.com in /etc/hosts file. We get these weird json-parsing errors for json endpoint throws exceptions:

Windows 11 development 2023-11-28 19-46-30

  1. cloud.51degrees.com is reachable but returns an error (f.e. a 500 status, achieved by the response rewrite via Charles Proxy) - we get an error that javascript fails to load and thus fod object is undefined:

Windows 11 development 2023-11-28 19-42-39

  1. Sometimes we get a combination of the two (it might depend on the state of the lazy properties of the CloudRequestEngine - whether they are loaded or not):

Windows 11 development 2023-11-28 19-48-20

Objective

Please analyze and fix these failures - so that in either case javascript and/or json is returned gracefully, fod object is defined, the errors should be logged via console.log, but we should not get javascript crashes. The scenarios are produced by a pairwise product of WebPipeline state (lazy properties were loaded or not) and failure type (no connection, or an error of the cloud.51degrees.com resource).

justadreamer commented 11 months ago

addressed by the above mentioned PR