I am not getting errors in GoogleAdsException But recieves in ApiException - exception

I am trying to handle keyword policy violation error in google ads api. I am trying the given example. https://github.com/googleads/google-ads-php/blob/main/examples/ErrorHandling/HandleKeywordPolicyViolations.php
They say the error will be thrown in GoogleAdsException and it can be handled with the googleAdsException object. But I always get the error in ApiException.
Can anyone help me? Thank you in advance.

it's been a while, but I just stumbled across this. I had implemented it exactly as Google suggested. It worked just fine.
Now it no longer works. The only difference is that now I don't have grpc and protobuf compiled as an extension for PHP, but have pulled the packages in via composer as PHP source. And look, there is only the GoogleApiException. However, this contains all the necessary data, only I have to write a different handling.
Conclusion: I suspect it's because the PHP packages via composer give different results than the compiled PHP extensions.
I can't tell more precisely at the moment, because I can't test compiled extensions here right now.

Related

Derivatives API Java Client Role Enums

We have recently updated to the latest forge-api-java-client jar.
There are currently issues when calling /modelderivative/v2/designdata/{urn}/metadata during a PDF upload.
As the request object cannot be mapped into the Manifest response due to errors with unknown enums being returned for ManifestChildren.RoleEnum
Manifest -> ManifestDerivative -> ManifestChildren -> RoleEnum
I have been able to work around this issue by adding the four missing enums (leaflet, leaflet-zip, pdf-strings, pdf-page) to the jar and building it locally.
I have searched and cannot find any release notes around these new enums/response objects, and was wondering if I could get pointed in the right location for these changes so I can keep an eye on future updates.
Also I would like to confirm that there are not other changes in the recent updates that may affect other Manifest responses we have not yet seen.
Thank you for any help.
Thank you for bringing that up. The leaflet/pdf roles have been around for a while but I don't see them documented anywhere, either. I'll talk to the Model Derivative team and make sure that the roles are documented.
As for the Java SDK, please submit a Github issue or a pull request to https://github.com/Autodesk-Forge/forge-api-java-client and we'll take a look at it.

Cordova File Download and open it using cordova

Please forgive my ignorance, Any advice/directional assistance would be greatly appreciated.
I have a small app that reads data from an API with json requests.
One of the actions the app needs to do is to download a given PDF and open it either in the app, or in the OS default viewer.
I have followed several guides, but I think I am not including all needed files or something. The guides don't speak of including files of any type, but I still get errors.
In this link for example I followed the steps, but I am getting an error when I add these two lines in to the script at the bottom of the page:
var fileTransfer = new FileTransfer();
console.log(FileTransfer);
When running that I get the error Uncaught ReferenceError: FileTransfer is not defined at employee_documents.html:102
I am sure that either i am not including the files correctly in netbeans or I am missing something simple...
Any advise would be greatly appreciated.
To answer the question specifically. In order to solve the error, you need to run the cordova app using the CLI. In that way, the plugins installed from your cordova will be used otherwise if you're only running it via refresh or something similar it will produce an error like this.
In other words, type this command in your CLI:
cordova run browser
You can change this to your preferred platform (android, ios)

Getting exception "Unknown Error" after bundling the application(exe)

We are using the evaluation version of JXBrowser for some charting application. We wanted to showcase a demo to our client just to check the overall performance of charts with JXBrowser. But we encountered some unexpected issue while we were trying to build an "EXE".
The issue:
We created a build and the passed the URL from the classpath(webView.getBrowser().loadURL(getClass().getResource("/chartiq/stx-advanced.html").toExternalForm());); the build successfully generated and if we run the build we are getting exception "Unknown Error" but its working fine in the IDE(Eclipse).
Afterwards, we tried to host the html pages at some server and we were able to get the html rendered in the application.
Question:
1. Is the aforementioned issue related to evaluation version?
2. If above question is not the case, is there any fix for that? As we have crawled the web and find nothing related to this.
For the reference I attached the screen shot showing the full exception stacktrace.
Any help will be appreciated.
Thanks,
Nikhil
The reason of this issue is that JxBrowser doesn't support loading resources from JAR files. Chromium engine used in JxBrowser cannot load the /chartiq/stx-advanced.html file located inside JAR archive. You need to extract the file and load the extracted file.
FYI: we have already started working on the functionality that allows loading HTML files and other resources from JAR archives. An updated build with this functionality will be available in December.

Google Maps API non-minified/obfuscated

Does Google provide non-minified / non-obfuscated versions of their various javascript API's?
For example, I'm using their LocalSearch control and getting a cryptic error "a is null". Setting a breakpoint in Firebug is not very helpful because I'm 3 levels deep in minified code.
There isn't a non-obfuscated version of the API (it isn't an open source project). If you post a link to the page in question, we might be able to help debug the issue?
I have seen the "a is null" message many times and each time have been able to track down the issue eventually.
As mentioned, there isn't a way to get the original version with real (helpful) variable and comments since it's not open source
But! There's a new(ish?) feature in Google Chrome Dev Tools where you can de-minify code ("make minified code human readable")
https://developers.google.com/web/tools/chrome-devtools/javascript/reference#format
should at least help a bit with debugging

Applet works when ran from Eclipse, not so well in the browser

I have a Java applet related problem and I would appreciate your help. Here's the story:
I tried creating an applet, that would try to connect to digg.com and by using it's API, show the 100 most popular stories (also include some options to sort and filter the results).
Anyway, the applet opens and shows the GUI just fine in the browser, but when I press the button that loads the news, it won't load them, BUT the news are loaded, when I run the applet in Eclipse.
I thought, that maybe the problem is related to creating the runnable jar from eclipse, since I have some referenced libraries (Google GSON for handling JSON from digg.com). Here are the settings I used for creating the runnable jar (I also tried "Package required libraries into generated JAR):
http://img816.imageshack.us/img816/417/exportjar.png
Here's a picture of the applet (ran from eclipse), when the news have been loaded:
http://img841.imageshack.us/img841/9121/applet.png
I would appreciate any ideas on how to get loading the news to work in the web browser.
I think torah is right. Applets should be able to connect only to their own server. You can try and trick the browser, sending request back to your server asking it to retrieve the data and to return it to applet.
What happens when you attempt to open the connection to digg? Is there a security exception? I wouldn't be surprised to learn that the JVM inside the browser was implementing a same origin policy. If this is the case there should be some kind of Exception (SecurityException I think) being raised when you try to connect to digg.com.
A quick search for "same origin policy java" found the following article which both seems to confirm that this could be your problem.
http://www.zdnet.com/blog/security/defeating-the-same-origin-policy-part-1/946