Reconstructing magma failure and the degassing network of dome-building eruptions