Don't throw an exception when the argument to %j is an object that contains circular references, it's not helpful. Catch the exception and return the string '[Circular]'.