(ssg-wsg) Keep getting error with error code 403 - ssg

i am in UAT Phase and try to call the UAT API but keep getting error with error code 403, what shd i do to be able to call the API, below pict is my code
enter image description here

There doesn't seem to be enough information to tell what is the problem. Since you are given UAT access, the proper channel would be to contact their service desk on your issue: https://developer.ssg-wsg.gov.sg/webapp/faq?anchor=WhoCanIContactIfIHaveQuestionsAboutTheseAPIs

Related

RSpec - Expecting a 500 error after completing a JS prompt modal

I'm working on an interface where the user creates an entity and gives it a name via a simple JS alert prompt, and by design our back-end returns a 422 error if you submit a name that already exists in the database. My task is to then display a message on the front-end after this error happens.
I'm using accept_prompt(with: "NAME") to properly test the modal functionality, but I'm having a hard time telling Rspec to expect an error from the attempted POST that results from completing the prompt.
I've tried the code below and variations of it but it always seems like Rspec fails with "no error was raised" and then immediately fails with ActiveRecord::RecordNotUnique: PG::UniqueViolation: ERROR(the exact error I'm trying to expect).
expect do
accept_prompt(with: "NAME") do
find(".selector .selector-item:first-child").click
end
end.to raise_exception
I've even tried the below code to no avail:
expect accept_prompt(with: "NAME") do
find(".selector .selector-item:first-child").click
end.to raise_exception
Is there some other known way to expect an error from a modal interaction in Rspec, or is it simply not possible?
We just resolved the issue, turns out the 500 error in the spec was caused by a problem with my spec configuration, unrelated to the 422 error that we expected to get and handle in the interface. Once we addressed that issue the 500 error went away and did not break the test, allowing us to continue running assertions against the frontend error validation.
So while there doesn't seem to be a way to actually catch and expect a backend error using Capybara, we didn't need to because that error wasn't supposed to be happening.

Google Bigquery Backend Error with streaming inserts but not display in console

I am getting following error from Google bigquer while doing streaming inserts:
Error message Signet::AuthorizationError: Unexpected status code: 500. Server message: { "error": "internal_failure" }
I can understand that there can few errors but the same doesn't get reflected on console as shown below:
As you can see in above, image, there are no 500 errors but yet in real there were 10 500 internal_failure errors.
Can you tell me why these errors don't refect on console & how do I ensure they don't happen?
This looks like a failiure to get your authentication token. This failure would occur before the client code even attempts to call the bigquery api, so the console you are looking at is accurately representing traffic.
I suspect it is a failure on a request to https://accounts.google.com/o/oauth2/token. Perhaps monitoring on outgoing http requests could verify this? (For example, see Getting error 500 when trying to obtain access token from authorization code and Internal_failure while getting refreshtoken using code?)
Back to the BigQuery API: when it returns an http error code 500, the error string will be one of "backendError" or "internalError". (For the curious: "backendError" is usually retriable, while "internalError" is likely a permanent failure.)

Plivo "Bad Media Description Error"

I'm using Plivo WebRTC to make and received VoIP calls. Sometimes when I use Plivo.conn.call from JS SDK to start a call a get "Bad Media Description" error. This happens once every five to ten calls. Does anybody knows what "Bad Media Description" error means? Has anyone had this problem?
Thanks!
You could have looked into the Plivo JS Library using the Chrome console debug with break points. This way you could have identified the issue yourself.
It seems that this error occurs when the received response does not include the SDP (answer body) which is translated into a 400 type error or when something goes wrong when creating the answer (perhaps setRemoteDescription), which is very generic and translated into a 488 type error.
You should put more logs and steps if you want to receive any help, but other than that, there is not enough information to go on...

How to log error 500 in wcf applications

We all are know some time we will get 500 error while trying to hit wcf url. for example if pass string value to integer parameter it will throw 500 error as request error. my question is how to log, this kind error in some file? because this will not reach our actual end point class coding right? so how to log this error in some file?
Any Help?
Assuming you want to log these on the server size, you should configure WCF tracing and use SvcTraceViewer to analyze the logs. More details on MSDN: http://msdn.microsoft.com/en-us/library/ms732023.aspx.
I may very well be wrong here - but if the client is supplying the wrong parameters to a web method, that would be a 404 as no method matches the incoming request?
I would say it's the clients job to send the right data to the right function, and to handle failures appropriately (an EndPointNotFoundException perhaps)

Which Http Status code to return when user provided data fails validation in Web Service?

When the user enters data and submits that data, we pass it to the server using and XMLHttpRequest. But, if that data fails validation, we have to return a 400 level status code. I thought the appropriate code would be 403. However, my colleague doesn't agree but doesn't know which to use.
Which one would you use?
Thanks!
400 would be more correct, i.e. the request contained invalid data. 403 would imply some kind of permisions error, i.e. the request was well formed and correct but the action was not allowed. If i was writing code to consume a web service and i got a 403 error it would never occur to me that it was because i was sending invalid data, it would be very confusing indeed.