Questions tagged [error-suppression]

Error suppression is the act of preventing an error from surfacing in programming, without addressing it. (Note that suppressing errors is very often considered bad practice.)

Error suppression is the act of preventing an error from making itself apparent, without actually addressing the error itself (the act of addressing the error is ).

Common methods of error suppression are surrounding it with try-catch / try-except statements, redirecting program output, and catching interrupts.

It should be noted that while there are a few circumstances where error suppression may be useful, it is usually looked on as bad practice, as suppressing errors can make debugging the code later a notoriously difficult prospect.

79 questions
2
votes
1 answer

Suppress error message when using fitdist() from the fitdistrplus package

I am using certain functions from the fitdistrplus package as a part of a package I am creating. I am attempting to prevent any error messages from displaying in the console when the functions are run and instead want to record the error messages…
Rage
  • 303
  • 1
  • 12
2
votes
0 answers

How to supress a -fpermissive error using modern gcc?

I am trying to compile some nonconforming code in c++17 but am stuck at the with the following issue. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-fpermissive" Some code that compiles only when with -fpermissive flag is set #pragma…
Andreas
  • 167
  • 1
  • 7
2
votes
2 answers

Store those filenames in a variable that were not copied to the destination using batch

I have created a batch file that is copying filese and sub folders from source to destination. I have suppressed all sorts of errors. Following is the code which I am using currently: Echo ****Copying...**** XCOPY "C:\Users\xxxxxx\Desktop\Source"…
2
votes
1 answer

How to make valgrind report only errors matching a rule

I know how to filter out errors based on suppression rules, but is it possible to make valgrind only show errors that match some criteria? Reverse suppression or kind of whitelisting if you will.
SnowFatal
  • 2,421
  • 1
  • 12
  • 12
2
votes
0 answers

strange gdbserver output shows at my target device

when I run gdbserver on uclinux target device blackfin bfin537/stamp it work perfectly but it always generates annoying output Request to get for unknown register 232 Request to get for unknown register 236 it is extremely annoying since each step…
Sina Sou
  • 149
  • 1
  • 6
1
vote
0 answers

Disabling "Restore Windows" message in Lion

We have a process that scans 3rd party plug-ins in the background. It seems that Lion is popping this "The Application X unexpectedly quit while.." every time the process crashes. How can we suppress this messages? Thanks
kambi
  • 2,839
  • 7
  • 32
  • 52
1
vote
0 answers

Suppressing errors in LoadLibrary

I'm trying to get rid of the error messages Windows sometimes pops when loading a DLL. I tried to do the following: UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); SetErrorMode(oldErrorMode |…
kambi
  • 2,839
  • 7
  • 32
  • 52
1
vote
1 answer

GraphQL disable input validation, add custom error

Trying to disable explicit message on input validation errors. When I request a field that does not exist (i.e age) i get: { "data": null, "errors": [{ "path": null, "locations": [ { "line": 1, …
Asaf Maoz
  • 607
  • 2
  • 6
  • 19
1
vote
0 answers

PHP showing errors, although display_errors is set to 0

I'm struggling for an hour, trying to figure out why is PHP showing errors although I suppressed them at the very begginging of my code like this: error_reporting(E_ALL); ini_set('log_errors', 1); ini_set('display_errors',…
1
vote
1 answer

Using @ (at sign) in PHP Laravel strings

I have the below code in my app. The problem is the @ (at sign). When it's there, I get syntax highlighting and errors as if the string doesn't end. When remove it, the page works fine (minus the action not existing). I've tried escaping the @ and…
1
vote
0 answers

Watir: Suppressing object timeout to favor my own error

I am working with an automation framework that deals with hundreds of test cases, and once all the scripts are written - thousands. The application under test has an error page that displays when there is an internal error, which results in our…
C Scordias
  • 21
  • 2
1
vote
1 answer

Why do I have to suppress errors for my function to work

Hi I have a script to log people into my site and within the script is this method (I have changed the values) $con=mysql_connect("mydbdomain", "mydbusername", "mypassword"); Now I downloaded a open source file upload program and uploaded it to my…
Banned_User
  • 837
  • 2
  • 9
  • 16
1
vote
3 answers

When to use @, and different ways to declare variables?

I'm learning object oriented php. I've come across some code I don't fully understand. This code is within a class. 1) code that uses @. For example: $this->image = @imagecreatefromgif($filename); Can some one explain the uses of @. 2) Also it…
seamus
  • 1,949
  • 4
  • 22
  • 33
1
vote
7 answers

How to suppress "is not a valid MySQL result resource" errors

I have a simple script to check how many files a user has uploaded: $sql = "SELECT * from $username where file IS NOT NULL"; $result = mysql_query($sql); $count=mysql_num_rows($result); If the table $username does not have any rows where file is…
user187680
  • 657
  • 1
  • 6
  • 19
1
vote
1 answer

opendir trying to find paths which don't exist now because they're renamed

I am setting up renaming functionality a part of a crud system for dirs, and right setting up a process to rename sub-directory of an uploads directory and the renaming process is working meaning dirs are being renamed accordingly yet I am getting…
eNigma
  • 91
  • 2
  • 10