I was starting to regret using SMO, because of the vague error messages.
Here is an example:
Exception calling “SqlRestore” with “1” argument(s): “Restore failed for Server ‘SM001’. ”
But this was fairly easy to resolve with an extra piece of code in my catch block:
Here is the new error message:
There is insufficient free space on disk volume ‘E:\’ to create the database. The database requires 6346801152 additional free bytes, while only 5079326720 bytes are available.
Problems were identified while planning for the RESTORE statement. Previous messages provide details.