To obtain the last error that occured then use the LastError function.
Possible return values:
0 - No error.
-1001 - Source file is nil.
-1002 - Could not open file.
Other non zero values are possible, their meaning will come from the operating system.
AppleSingleEncoderStream Class