File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -3337,4 +3337,12 @@ pub enum AmlError {
33373337 /// This is emitted to signal that the library does not support the requested behaviour. This
33383338 /// should eventually never be emitted.
33393339 LibUnimplemented ,
3340+
3341+ /// The library has given a response the host does not understand, or the host is otherwise
3342+ /// unable to continue operating the library correctly. The specific reason is given in the
3343+ /// contained String.
3344+ ///
3345+ /// This variant is set by the host, not by the library, and can be used when it is convenient
3346+ /// not to construct a more complex error type around [`AmlError`].
3347+ HostError ( String ) ,
33403348}
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