user3044294
user3044294

Reputation: 205

How to handle http 500 error?

i try to send following commands within httpNancy server. now i want to check whether it can happen 500 http reject error . does anyone can guide me ?

    public CommandModule(ICommandFetcher fetcher, ICommandBus commandBus)
    {
        Post["/"] = parameters =>
        {
            var commandRequest = this.Bind<MessageEnvelope>();
            var command = fetcher.FetchFrom(commandRequest);
            commandBus.Send((ICommand) command, commandRequest.MetaData);
            return HttpStatusCode.OK;
        };

    }

Upvotes: 1

Views: 1050

Answers (3)

Christian Horsdal
Christian Horsdal

Reputation: 4932

I think what you need is the error handling application-level hooks as documented on the wiki

Upvotes: 3

Ragesh Puthiyedath Raju
Ragesh Puthiyedath Raju

Reputation: 3939

Please look at this example.

https://github.com/NancyFx/Nancy/issues/452

Hope it help.

Upvotes: 1

Rishi Jagati
Rishi Jagati

Reputation: 626

In most of the case 500 server error will occure when your system memory gets high or system RAM is consumed in that much ammount that it can't be able to send the request. close some unnecessary running applications to reduce it.

Upvotes: 1

Related Questions