The .create() method would throw an error if the file extension was not .mat and would tell you that it got something else instead. In edge case where the extension was empty the error message read weird:
"File must have .mat extension, got:"
Not the error handles this edge case and provides a more useful message