Forbidden error HTTP Status 403 for Tableau getUnderlyingDataAsync API - javascript

I am using getUnderlyingDataAsync JS API to fetch data and to check the rowcount for a sheet for my local validation purpose and it works for creator role and not working for viewer or worker role. I got the below error. Is there any way I can bypass this error and why do we need to have this restriction for API calls?
ERROR Error: Uncaught (in promise): Error executing JS API command:
getUnderlyingDataAsync
Details:
api-get-worksheet-underlying-logical-table-data: {"code":0,"message":"PermissionDeniedException"}, status: 403, textStatus: error
at X (polyfills.0e0307f4410f68cf.js:1:16680)
at polyfills.0e0307f4410f68cf.js:1:15763
at v (main.bc6c811d2bb612a1.js:1:835786)
at Y (main.bc6c811d2bb612a1.js:1:835995)
.............

Related

Vue Axios Uncaught (in promise) GET Request Error

axios.get('localhost:3000/api/event')
.then((response) => {
console.log(response);
});
The above code is being used in one of my Vue files and is retrieving data from a server I have set up and successfully tested endpoints with in Postman. The server is currently running, and I am trying to do a get request (from a separate file folder-my client) from the database. When I try this, I get "Uncaught (in promise) AxiosError \ code: ERR_BAD_REQUEST" in my console.
I have looked through other similar questions: vue axios Uncaught (in promise) Cancel , Vue axios error Uncaught (in promise) Error: Request failed with status code 415 , and others but found either an unsatisfactory answer or no answer at all.
My endpoint is correct, the server is running (I can query that same endpoint with Postman and get the JSONs I desire), and I believe my syntax is correct for the axios code. I would love some help with this please.

JavaScript fetch ERR_CONNECTION_REFUSED vs TypeError Failed to fetch

When using the JavaScript fetch API, the browser's console logs an error of ERR_CONNECTION_REFUSED, but the catch block of fetch returns a message of TypeError Failed to fetch when a server is offline.
Example
The following minimal fetch highlights the two error messages:
fetch("https://localhost/get-something", {
method: "POST"
}).then(resp => {
console.log(resp)
}).catch(err => {
console.log("ERR:", err, err.name, err.message)
})
When running the fetch, the browser's console will have two errors:
POST https://localhost/get-something net::ERR_CONNECTION_REFUSED
And
ERR: TypeError: Failed to fetch
// err.message will be "failed to fetch"
The generic failed to fetch message from the catch block is returned in instances other than a server being down. I'm more interested in the browser's console error of ERR_CONNECTION_REFUSED.
Question
Is there a way to capture the ERR_CONNECTION_REFUSED value in a failed fetch call?
Unfortunately this is not possible as this kind of message is printed in the console from Chrome itself. Suppressing these types of messages has been debated for years, but the consensus seems to be that these kinds of messages are desirable.
you can only hide them from your client using the filter check this:
https://umaar.com/dev-tips/79-hide-network-console/

Uncaught (in promise) Type Error when trying to fetch for URL

I made a server using Node.js and used the Express framework. Once the server was running, I went to Google Chrome and when to inspect element and went to the console, and typed - fetch('http://localhost:7500'). I was expecting to get the CORS error(Which I wanted) but instead got this:
VM267:1 GET http://localhost:7200/ net::ERR_BLOCKED_BY_CLIENT
VM267:1 Uncaught (in promise) TypeError: Failed to fetch
at <anonymous>:1:1
Is there any way to resolve this error?

Getting error in react while using WebRTC

Am using webRTC in my reactJS app,
so am doing everything in webRTC like i used to do in normal javascript file , but on react when ever i establish a call i get this error
index.js:1540 Uncaught Error: The error you provided does not contain a stack trace.
at S (index.js:1540)
at V (index.js:1792)
at index.js:1807
at index.js:1826
at a (index.js:1371)
and this
Uncaught (in promise) DOMException: The play() request was interrupted by a new load request. somelink
and also only my own streaming are showing , the other peer streaming is not been played

SAP Cloud SDK JavaScript: No CSRF Token for onPremise destination with Location ID

I have an application on SAP Cloud Platform which uses the SAP Cloud SDK JavaScript (Version 1.11.3) to communicate with an OnPremise Destination with corresponding Cloud Connector.
Requests work fine when the property "Location ID" is empty on both the Destination and the Cloud Connector.
However, when specifying a value for the Location ID (both on Destination and Cloud Connector) only GET requets work.
Other requets (e.g. PATCH, POST) fail with the following error message:
ERR Destination did not return a CSRF token.
This may cause a failure when sending the OData request.
ERR CSRF header response does not include cookies.
...
ERR Error: Create request failed!
...
ERR Caused by:
ERR Error: post request failed!
...
ERR Caused by:
ERR Error: Request failed with status code 403
This did not occur when working with the SAP Cloud SDK for Java.
Am I missing something? Should I set the "x-csrf-token" header manually?
This was a bug in the SDK and was fixed in version 1.13.1.

Categories

Resources