Jpl/surface pg error code

This is 3 months old, and is what we're depending on in bifrost.  If this is ready to go, it should be merged.