             @__is_saving = true
             @__save (err) =>
                 @__is_saving = false
-                if err?.slice(0,5) == 'FATAL'
+                if is_fatal(err)
                     @_fatal = true
                 cb?(err)
 

schema         = require('./schema')

{defaults, required} = misc

# We represent synchronized tables by an immutable.js mapping from the primary
# key to the object.  Since PostgresQL primary keys can be compound (more than

                # 2. Now actually do the changefeed query.
                @_reconnect(cb)
        ], (err) =>
            if is_fatal(err)
                # This happens, e.g., when a user is no longer a collaborator on a project, or they are signed out
                # but still have a bunch of tabs open.  It avoids a huge amount of back and forth traffic between
                # the client and server.   WORRY: when they sign in, things will not just start working again...
