try catch in php pdo, doing it right way

I am using php pdo with postgres. I am using core php, no mvc, no classes and objects. I have some doubts in my mind since i am new to development, :- Should i use try catch on every query execution. And if i use try catch then should i exit the ru...
more »

2017-12-02 11:12 (2) Answers

Exception Thrown by CrudRepository save method

I am using CrudRepository save method to persist Profile Object in my Spring boot project as below: public Profile getProfile(String profileId, String email){ Profile profile = null; MyClass myObj=new MyClass(); Profile...
more »

2017-12-01 07:12 (0) Answers

Java - Adding up integers from a file

I'm having problems with adding integers that are in a file. The code works fine displaying the integers but as soon as I add "total += scanner.nextInt();" it skips every other integer (e.g if file contained - 10, 20, 30, 40, 50, it would only displa...
more »

2017-11-29 17:11 (2) Answers

C# DllImport crashes unexpectedly

I have a C# Application with a C++ component. I am communicate with DllImport between the modules. The Application works for many days without a problem and crash sometime unexpectedly. [DllImport("recorder", CallingConvention = CallingConvention.Cd...
more »

2017-11-27 09:11 (1) Answers

Exception before Main

I created app with following code (just for research purposes): using System; using System.CodeDom; using System.Linq; using System.Reflection; using System.Security.Permissions; namespace HelloWorld { public class Program { static ...
more »

2017-11-25 20:11 (2) Answers

Java exceptions wrapping: bad practice?

Coming from a PHP world where there's only one way to write exceptions handling.. I found the wrapping of exceptions in Java a bit "ugly": public void exampleOneException(String input) throws MyBusinessException { try { // do something ...
more »

2017-11-16 09:11 (4) Answers

Error: unexpected '}' in "}"

My code is as follows, `FARS = read.csv("C:\\Users\\rb138\\Desktop\\FARS.csv", header = T, sep = ",", na.strings=c(""," ","NA-code","NA")) Preprocessing = process() { FARS$X = NULL library(caTools) <- FARS == "NULL" miss<...
more »

2017-11-13 12:11 (1) Answers

In PHP, what is the `ClosedGeneratorException`?

When looking through the output of get_declared_classes() in PHP 7.0 and 7.1, I noticed a ClosedGeneratorException. The manual does not make much mention of it and it does not seem to be listed on either the Predefined Exceptions or SPL exceptions e...
more »

2017-11-08 16:11 (1) Answers

Read non-printable character from a file

I'm trying to read a character as an integer from a file and I receive an exception of NumberFormatException: Java.lang.NumberFormatException: For input string: "4
" java.lang.NumberFormatException.forInputString( ...
more »

2017-10-29 09:10 (1) Answers

How to catch ORA-28002 in Zend Framework

I'm useing Zend Framework 1 with Oracle database like this: Bootstrap.php: protected function _initDb() { $resource = $this->getPluginResource('db'); $db = $resource->getDbAdapter(); Zend_Db_Table_Abstract::setDefaultAdapter($db);...
more »

2017-10-19 18:10 (0) Answers

isinstance() unexpectedly returning False

I am using the kubernetes python client. In the event that kubernetes isn't available when my code starts up, I would like to retry the connection. When the client is unable to connect, it throws what appears to be a urllib3.exceptions.MaxRetryEr...
more »

2017-10-12 19:10 (1) Answers

Validating Non Negative Integer Java

So I am trying to do input validation for an integer. I am able to check non integer characters and also for integers but I am not sure how to loop both of these conditions. So for example if the user enters 'a', then '-1', and then 'a' again. Here i...
more »

2017-09-20 06:09 (3) Answers

*When* does a C++ exception blow up C code

Ok, so I need -fexceptions to allow a C++ exception to propagate through C code. I tried to compare the results from both C++ and C, and, from what I can tell, the compiled routines are identical at the assembly, even without that option [1]. Here is...
more »

2017-09-12 20:09 (1) Answers

Zend controller exception

I was requesting a page by submitting a form and sending the data to controller action . But it throws me the following error : Internal error: Permission denied.#0 /usr/local/psa/admin/externals/Zend/Controller/Plugin/Broker.php(309): Plesk\...
more »

2017-08-24 14:08 (0) Answers