From b44cf1c090287f6c285f902841b3d4fe3abeec71 Mon Sep 17 00:00:00 2001 From: octave99 <36263355+octave99@users.noreply.github.com> Date: Tue, 28 May 2019 06:33:02 +0000 Subject: [PATCH] Add Migration steps for Custom Error 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