File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3335,4 +3335,12 @@ pub enum AmlError {
33353335 /// This is emitted to signal that the library does not support the requested behaviour. This
33363336 /// should eventually never be emitted.
33373337 LibUnimplemented ,
3338+
3339+ /// The library has given a response the host does not understand, or the host is otherwise
3340+ /// unable to continue operating the library correctly. The specific reason is given in the
3341+ /// contained String.
3342+ ///
3343+ /// This variant is set by the host, not by the library, and can be used when it is convenient
3344+ /// not to construct a more complex error type around [`AmlError`].
3345+ HostError ( String ) ,
33383346}
Original file line number Diff line number Diff line change @@ -325,14 +325,14 @@ where
325325 match * result {
326326 Object :: Integer ( 0 ) => Ok ( ( ) ) ,
327327 Object :: Integer ( other) => {
328- error ! ( "Test _MAIN returned non-zero exit code: {}" , other) ;
329- // TODO: wrong error - this should probs return a more complex err type
330- Err ( AmlError :: NoCurrentOp )
328+ let e = format ! ( "Test _MAIN returned non-zero exit code: {}" , other) ;
329+ error ! ( "{}" , e ) ;
330+ Err ( AmlError :: HostError ( e ) )
331331 }
332332 _ => {
333- error ! ( "Test _MAIN returned unexpected object type: {}" , * result) ;
334- // TODO: wrong error
335- Err ( AmlError :: NoCurrentOp )
333+ let e = format ! ( "Test _MAIN returned unexpected object type: {}" , * result) ;
334+ error ! ( "{}" , e ) ;
335+ Err ( AmlError :: HostError ( e ) )
336336 }
337337 }
338338 } else {
You can’t perform that action at this time.
0 commit comments