I have some questions in try catch regarding which types of exceptions to put. This example would be the best option?
try {
String folerPath = Environment.getExternalStorageDirectory() + File.separator + "Folder" + File.separator;...
I have a question about how to apply try and catch to a method.
public function cadastrarUsuarios(parametros){
mysqli_query($this->conexao,"INSERT....");
// Aqui que vem a dúvida
try{
if(mysqli_affected_rows($t...
I have the following code, which tries to click a button after 60 seconds, and if it has not loaded, try again after 60 seconds.
while(true) {
var timeout = setTimeout(function() {
try{
document.querySelector...
I have source where I need to now adapt it to use try , catch , finally and exception and I'm not getting it, this font already has some try´s com catch(PDOException $erro) where I do some validations, bec...
When optimizing my JDBC code I started using a condition inside the try.
/** Função PreparedStatement stmt */
public PreparedStatement stmt;
/** Funçãoo ResultSet rs */
public ResultSet rs;
/** Método LoginDao - construtor */
public Login...
I have a WCF Service on a server whose service is also configured as WebInvoke:
[WebInvoke(
Method = "POST",
UriTemplate = "/work",
BodyStyle = WebMessageBodyStyle.WrappedResponse,
ResponseFormat = WebMessageFor...
I'm trying to make a dynamic file call where I have a input that gets a name and a file with that name is loaded in the <source> in js, when the person types a file name that does not exist in the folder you would need to dis...
Good afternoon
Below is a method that I use to read certain files in a folder. The problem is this. If the folder has 50 files (or 60, or 70, or 80 ...) and the method is reading a "defective" file (one of the files that fall in Exeception...
Here at work I came across a code that treats an error in an if instead of try / Catch. The programmer justifies that catch interrupts the code, but I believe that a Finally guarantees execution. Can you tell me what would be the best option for...
My problem is to rewrite a code using the try-with-resources feature, as I'm new to the programming world, I'm not able to learn how to do this, which is becoming rather overwhelming because it's apparently simple but I'm not getting it.
I...