Questions tagged [error-handling]

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

22 questions
7
votes
2 answers

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
  • 1,334
  • 2
  • 11
  • 14
6
votes
2 answers

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 be a date time of when the error was generated. …
Colyn1337
  • 2,387
  • 2
  • 22
  • 38
4
votes
1 answer

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). Powershell sees the error state, throws an error and…
Mark Henderson
  • 68,316
  • 31
  • 175
  • 255
3
votes
2 answers

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 the nginx default 404 page not found. Why is…
3
votes
1 answer

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 never created or modified, regardless of the…
Massimo
  • 68,714
  • 56
  • 196
  • 319
3
votes
3 answers

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 the Break commands, but they don't do what I want. …
Nick
  • 256
  • 1
  • 5
  • 20
2
votes
1 answer

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 reconnect. In my code I catch this error…
NG.
  • 123
  • 2
  • 8
2
votes
3 answers

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 DOWNLOADED_ARTIFACT=$(downloadApplication "$WEB_GROUP") if [[ $? !=…
Anders S
  • 121
  • 2
2
votes
3 answers

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 the PC RAM?
Olgun Kaya
  • 137
  • 2
  • 10
2
votes
1 answer

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 folder (like .git). This can be easily done via…
2
votes
2 answers

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 successfull preparation step, ansible cannot…
anx
  • 6,875
  • 4
  • 22
  • 45
2
votes
0 answers

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 to display errors from our application on the…
oucil
  • 445
  • 3
  • 16
1
vote
0 answers

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 I am able to delegate error pages to PHP and from…
jacmkno
  • 115
  • 7
1
vote
2 answers

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 error response in the HTTP response content. In…
Phani K
  • 115
  • 2
  • 4
1
vote
1 answer

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 invalid url, like: http://localhost/test/index.pXX, then i…
Holian
1
2