Skip to content

Commit

Permalink
✨ Improve errors and remove trailing slash / #1935
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandolucchesi committed Oct 17, 2023
1 parent 0dee368 commit ed0eb9c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sanityv3/resolveProductionUrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const remoteUrl = () => {
const env = window.location.hostname.includes('equinor-web-sites-preprod') ? 'preprod' : 'prod'
switch (dataset) {
case 'global':
return `https://web-equinor-web-sites-${env}.c2.radix.equinor.com/`
return `https://web-equinor-web-sites-${env}.c2.radix.equinor.com`
case 'global-development':
return 'https://web-global-development-equinor-web-sites-dev.c2.radix.equinor.com'
case 'global-test':
Expand Down
14 changes: 9 additions & 5 deletions sanityv3/schemas/components/VideoSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,15 @@ const VideoSelector = forwardRef(function VideoSelector(
headers: {
Authorization: `Basic ${SCREEN9_AUTH}`,
},
}).then((res) =>
res.status !== 200
? setError(`Could not retrieve url from Screen9. Please report the error to the dev team.`)
: res.json(),
)
})
.then((res) =>
res.status !== 200
? setError('Could not retrieve url from Screen9. Please report the error to the dev team.')
: res.json(),
)
.catch((error) => {
setError(`Could not retrieve url from Screen9. Please report the error to the dev team. Error: ${error}`)
})

if (!data.error) {
const video = {
Expand Down

0 comments on commit ed0eb9c

Please sign in to comment.