chiark / gitweb /
errors: Abolish alias OE for Fatal
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 13 Jul 2021 14:32:57 +0000 (15:32 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 13 Jul 2021 14:35:10 +0000 (15:35 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/api.rs
daemon/main.rs
daemon/session.rs
src/global.rs
src/prelude.rs
src/sse.rs
src/updates.rs

index ebf9f03d971f62319944facacbe425b94136daff..ee04ab661d34c7130c66fb777f5a84ff8ab761b4 100644 (file)
@@ -15,7 +15,7 @@ pub struct InstanceAccess<'i, Id> {
 }
 
 impl<'r, Id> FromFormValue<'r> for InstanceAccess<'r, Id>
-  where Id: AccessId, OE: From<Id::Error>
+  where Id: AccessId, Fatal: From<Id::Error>
 {
   type Error = OER;
   #[throws(OER)]
@@ -93,7 +93,7 @@ impl<'r> Responder<'r> for FatalErrorResponse {
   }
 }
 
-#[throws(OE)]
+#[throws(Fatal)]
 fn api_piece_op<O: op::Complex>(form: Json<ApiPiece<O>>)
                    -> impl response::Responder<'static> {
 //  thread::sleep(Duration::from_millis(2000));
@@ -194,7 +194,7 @@ fn api_piece_op<O: op::Complex>(form: Json<ApiPiece<O>>)
     prepub.finish();
   }
 
-      Ok::<(),OE>(())
+      Ok::<(),Fatal>(())
     })();
 
     let g = &mut *ig;
index 5c20e1af8f08a225f921b92e9f91cd005f923162..61fe654a7793ae32c0192827b590f1fff0a3a772 100644 (file)
@@ -111,7 +111,7 @@ fn loading_l(layout: Parse<AbbrevPresentationLayout>, ia: PlayerQueryString)
   loading(Some((layout.0).0), ia)?
 }
 
-#[throws(OE)]
+#[throws(Fatal)]
 fn loading(layout: Option<PresentationLayout>, ia: PlayerQueryString)
            -> Template
 {
index e1606da6cab4afd896fa6f41025a7c07b6da9cd5..8cb0b6a7ae98ed3672cfef0ac0564a00af3c778b 100644 (file)
@@ -89,7 +89,7 @@ impl SvgAttrs {
 
 fn session_inner(form: Json<SessionForm>,
                  layout: Option<PresentationLayout>)
-                 -> Result<Template,OE> {
+                 -> Result<Template,Fatal> {
   // make session in this game, log a message to other players
   let iad = lookup_token(form.ptoken.borrow())?;
   let player = iad.ident;
index f135d538d0cc1a08d3f24ca595ff068899e5a2e3..31d99f42a8048f32bdf0ba47158cad8e24396357 100644 (file)
@@ -598,9 +598,9 @@ impl From<&LinksTable> for Html {
 // ---------- Player and token functionality ----------
 
 impl<Id> InstanceAccessDetails<Id>
-  where Id: AccessId, OE: From<Id::Error>
+  where Id: AccessId, Fatal: From<Id::Error>
 {
-  #[throws(OE)]
+  #[throws(Fatal)]
   pub fn from_token(token: &RawTokenVal) -> InstanceAccessDetails<Id> {
     let g = Id::global_tokens(PRIVATE_Y).read();
     let i = g.get(token).ok_or(Id::ERROR)?;
@@ -1350,7 +1350,7 @@ pub fn lookup_token<Id:AccessId>(s: &RawTokenVal)
     .ok_or(Id::ERROR)
 }
 
-#[throws(OE)]
+#[throws(Fatal)]
 pub fn record_token<Id:AccessId> (
   ig: &mut InstanceGuard,
   iad: InstanceAccessDetails<Id>
index 83b6d9a19f3d91baf64d230758337d9037fe7a30..bd6ef8cb24b9d62369ff51e4bbf45a1b9f9e83f0 100644 (file)
@@ -196,7 +196,6 @@ pub type PUM = ProgressUpdateMode;
 pub type APOE = ApiPieceOpError;
 pub type ESVU<POEPU> = ErrorSignaledViaUpdate<POEPU>;
 pub type IE = InternalError;
-pub type OE = Fatal; // xxx get rid of this alyas when we've cleaned up Fatal
 pub type Ia = Inapplicable;
 pub type POEPP = PieceOpErrorPartiallyProcessed;
 pub type SvgE = SVGProcessingError;
index b939d7eaab04d921a6d4b001648852d8c69b56e9..9f8974446ab71659d172c2bafe39164da6af9481 100644 (file)
@@ -219,7 +219,7 @@ impl StableIndexOffset for UpdateId {
 
 // ---------- entrypoint for dribbling the http response ----------
 
-#[throws(OE)]
+#[throws(Fatal)]
 pub fn content(iad: InstanceAccessDetails<ClientId>, gen: Generation)
   -> impl Read {
   let client = iad.ident;
index 5a9a80ffc712eb969a6d3b9f26e397e08cc1ba5a..b01ed922e95047b31df788a26e7ede31d85b47d8 100644 (file)
@@ -284,7 +284,7 @@ struct FormattedLogEntry<'u> {
 
 // ---------- helpful utilities ----------
 
-#[throws(OE)]
+#[throws(Fatal)]
 pub fn log_did_to_piece_whoby(ioccults: &IOccults, goccults: &GameOccults,
                               by_gpl: &GPlayer,
                               gpc: &GPiece, ipc: &IPiece, did: &str)
@@ -311,7 +311,7 @@ pub fn log_did_to_piece_whoby(ioccults: &IOccults, goccults: &GameOccults,
   (log, Some(who_by))
 }
 
-#[throws(OE)]
+#[throws(Fatal)]
 pub fn log_did_to_piece(ioccults: &IOccults, goccults: &GameOccults,
                         by_gpl: &GPlayer,
                         gpc: &GPiece, ipc: &IPiece, did: &str)
@@ -615,7 +615,7 @@ impl<'r> PrepareUpdatesBuffer<'r> {
                             logents: Vec<LogEntry>,
                             partially: PieceOpErrorPartiallyProcessed,
                             client: ClientId, cseq: ClientSequence)
-                            -> Result<(),OE> {
+                            -> Result<(),Fatal> {
     let by_client = (WRC::Unpredictable, client, cseq);
     let mut buf = PrepareUpdatesBuffer::new(ig, None);
     let ops = PUOs::Simple(PieceUpdateOp::Modify(()));