@@ -8,7 +8,6 @@ use crate::StatusCode;
88// Need to rename Backtrace to CotBacktrace, because otherwise it triggers special behavior
99// in the thiserror library
1010use crate :: error:: backtrace:: { __cot_create_backtrace, Backtrace as CotBacktrace } ;
11- use crate :: error:: not_found:: NotFound ;
1211
1312/// An error that can occur while using Cot.
1413pub struct Error {
@@ -151,46 +150,6 @@ impl Error {
151150 Self :: internal ( error)
152151 }
153152
154- /// Create a new "404 Not Found" error without a message.
155- ///
156- /// # Examples
157- ///
158- /// ```
159- /// use cot::Error;
160- ///
161- /// let error = Error::not_found();
162- /// ```
163- #[ must_use]
164- #[ deprecated(
165- note = "Use `cot::Error::from(cot::error::NotFound::new())` instead" ,
166- since = "0.4.0"
167- ) ]
168- pub fn not_found ( ) -> Self {
169- Self :: from ( NotFound :: new ( ) )
170- }
171-
172- /// Create a new "404 Not Found" error with a message.
173- ///
174- /// Note that the message is only displayed when Cot's debug mode is
175- /// enabled. It will not be exposed to the user in production.
176- ///
177- /// # Examples
178- ///
179- /// ```
180- /// use cot::Error;
181- ///
182- /// let id = 123;
183- /// let error = Error::not_found_message(format!("User with id={id} not found"));
184- /// ```
185- #[ must_use]
186- #[ deprecated(
187- note = "Use `cot::Error::from(cot::error::NotFound::with_message())` instead" ,
188- since = "0.4.0"
189- ) ]
190- pub fn not_found_message ( message : String ) -> Self {
191- Self :: from ( NotFound :: with_message ( message) )
192- }
193-
194153 /// Returns the HTTP status code associated with this error.
195154 ///
196155 /// This method returns the appropriate HTTP status code that should be
@@ -216,6 +175,7 @@ impl Error {
216175 }
217176
218177 #[ must_use]
178+ #[ doc( hidden) ]
219179 pub fn backtrace ( & self ) -> & CotBacktrace {
220180 & self . repr . backtrace
221181 }
0 commit comments