From fe781345d5eb0c491039a4250a8a4862898a19b0 Mon Sep 17 00:00:00 2001 From: octave99 <36263355+octave99@users.noreply.github.com> Date: Wed, 29 May 2019 16:47:04 +0000 Subject: [PATCH] Add Migration steps for Custom Error (#869) Adds migration steps for custom error in 1.0 --- MIGRATION.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MIGRATION.md b/MIGRATION.md index 73669ddb8..1736ee65d 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -238,6 +238,17 @@ * Actors support have been moved to `actix-web-actors` crate +* Custom Error + + Instead of error_response method alone, ResponseError now provides two methods: error_response and render_response respectively. Where, error_response creates the error response and render_response returns the error response to the caller. + + Simplest migration from 0.7 to 1.0 shall include below method to the custom implementation of ResponseError: + + ```rust + fn render_response(&self) -> HttpResponse { + self.error_response() + } + ``` ## 0.7.15