Use javascript based standard error messages for graphs

Makes it easier to maintain