Build Script Error Handling Error

When an error occurs in the build script it attempts to log the error but does so in an invalid way.