improve error reporting for build_maglev