Questions tagged [error-handling]

constructs designed to handle errors signaled by error codes, exceptions or other specific means.

Filter by
Sorted by
Tagged with
7 votes
2 answers
16k views

How to make Batch-file automatically stop on error

Do anyone knows if there is a Windows Batch-file equivalent to Unix Stop on Error "#!/bin/sh -e"? (http://www.turnkeylinux.org/blog/shell-error-handling)
jpmartins's user avatar
  • 1,514
6 votes
2 answers
1k views

Query Powershell Error Object Time Occured

Powershell error objects contain a lot of data but I can't seem to track down the time of occurrence for a given error. Using $Error[0] | fl -f retrieves a lot of information but none that appears to ...
Colyn1337's user avatar
  • 2,417
4 votes
1 answer
7k views

Invoke-WebRequest - store request content even on error?

I am using Powershell's Invoke-WebRequest (this also applies to Invoke-RestMethod) to make a call to an ElasticSearch cluster. This specific command often returns an error result (409 conflict). ...
Mark Henderson's user avatar
3 votes
3 answers
25k views

How can I exit a function in powershell

I have a function that I know will throw an error. This error is expected, but when it's thrown I want to end the function. I have a Trap section in my script, and I have used both the Return and ...
Nick's user avatar
  • 256
3 votes
1 answer
458 views

Why are Exchange 2010 cmdlets ignoring ErrorVariable?

I'm trying to run Exchange 2010 cmdlets such as this one: Get-Mailbox UserName -ErrorVariable err However, the cmdlets seem to completely ignore the -ErrorVariable parameter: the variable $err is ...
Massimo's user avatar
  • 71.3k
3 votes
2 answers
3k views

ansible: How to properly handle errors that break handler notification?

A problem I keep running into in ansible is where one deployment step should run when any of a number of preparation step is changed, but the changed status is lost due to fatal errors. When after one ...
anx's user avatar
  • 9,738
3 votes
2 answers
2k views

Make Nginx route non-existent files to WordPress for 404 error handling?

I configured my WordPress website on Nginx and almost everything works as expected. I get the WordPress 404 for every non-existent page as expected -- except for non-existent .php pages! Those return ...
user103969's user avatar
2 votes
3 answers
3k views

Server RAM vs PC RAM

We want to buy some server RAM (one piece, 8GB). But since the price grows exponentially we are thinking about buying regular PC RAM instead. Would this cause problems? Should we go ahead and buy ...
Olgun Kaya's user avatar
2 votes
1 answer
22k views

Configure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errors

We have a NGINX reverse proxy (clustered) with 45 upstreams (22 domains, 20 subdomains, 11 apps). Some of our projects hosts apis for some users globally. Our developers designed special custom 500 ...
ender ulusoy's user avatar
2 votes
1 answer
5k views

Best way to handle 'MongoError: failed to connect to server on first connect' in Mongoose

In this GitHub issue for mongoose the developer stated that it is intended behaviour to crash the Node.js process if the initial database connection to MongoDB fails. It does this instead of trying to ...
NG.'s user avatar
  • 143
2 votes
3 answers
2k views

Bash function, return value and error handling

I am trying to wrap my head around Bash, and think I have gotten pretty far. What I really don't understand yet is the error handling... I have the following script: set -e set -u ...
Anders S's user avatar
  • 121
2 votes
1 answer
4k views

NGINX block location access and redirect to custom error page

I have a issue with my NGINX setting with redirecting to a custom error page on another location (incl. css, images, js) if a error page should be thrown. At first I would like to block access to an ...
devKyrios's user avatar
2 votes
0 answers
1k views

Apache with PHP-FPM intercepting errors and not displaying my friendly PHP error page output in dev environment

There is so much static around this it's hard to find an answer that actually applies, so my apologies if there is an answer for this, I just haven't been able to find it. My situation is that I want ...
oucil's user avatar
  • 598
1 vote
2 answers
5k views

Can we execute steps conditionally in a JMeter script?

I have recorded a sequence of steps to be executed for testing my web application, in a JMeter .jmx script. (The recording tool used was BadBoy). It is possible that one of the steps might return an ...
Phani K's user avatar
  • 115
1 vote
1 answer
2k views

Additionally, a 404 Not Found

A try to make my own errordocument on Localhost... In my .htaccess: ErrorDocument 404 /errors/404.php In the errros directory: 404.php The .htaccess in the root directory. But if i tpye some ...
user avatar
1 vote
0 answers
241 views

Handling errors with php on nginx reverse proxy, and mail response to admins

Is there a way to access the server response from php once Nginx detects an error, and mail the server response to the admins while at the same time show a custom error page to the visitor? Currently ...
jacmkno's user avatar
  • 115
0 votes
3 answers
6k views

Catching "request entity is too large" error

I am running a web server IIS 8.0 and using ASP.NET and C#. I have an upload box where the user can upload a file to the server and after a limit of about 50MB, a message appears on a white page: ...
noblerare's user avatar
  • 101
0 votes
1 answer
234 views

Nginx reverse proxy: How to serve 'back soon' html file while backend server restarts

I have a WSGI server behind by nginx. Say I bring the WSGI instance down for maintenance/update, is there a nice way of nginx automatically serving up any requests to that application with a specified ...
user1561108's user avatar
0 votes
2 answers
2k views

PHP not debugging/showing error messages

I've just installed lighttpd, and I'm not seeing any error messages on pages when I know errors must have occurred. All I get is a blank page. However, I do get the errors in the error log file - but ...
Matt's user avatar
  • 655
0 votes
1 answer
552 views

PHP exceptions cause nginx to leak virtualhosts into each-other

I have multiple nginx virtualhosts set up on my server. tershronalds.com is running vanilla wordpress 4.3, and staging.ninjawars.net is running a custom php codebase. Both are relying on php5-fpm. ...
Kzqai's user avatar
  • 1,288
0 votes
1 answer
59 views

Windows Handling Piped Comands Error Redirection

Warning: I am no expert on building scripts, and sorry for lousy English. In an case of generating a CSV from a database query I'm using the following commands. CALL java.exe -classpath ... com....
jpmartins's user avatar
  • 1,514
0 votes
0 answers
65 views

Can DispatcherPassError be set selectively for some URLs in AEM?

In AEM (Adobe Experience Manager) Dispatcher configuration, can the directive DispatcherPassError be set only to requests with some specific selector in the URL? I'd like the dispatcher to return a ...
pkalinow's user avatar
  • 101
0 votes
1 answer
54 views

Suppress error mails from cron if the jobs only fails occasionally

We have a bunch of cron jobs that occasionally fail, for example due to network hiccup. Only rarely do they fail consistently (for example due to a bug or misconfiguration). I'd like to receive only ...
moritz's user avatar
  • 151