public WriteResult say(DB db, OutMessage m, DB.WriteConcern concern) throws MongoException { MyPort mp = _threadPort.get(); DBPort port = mp.get(true); port.checkAuth(db); try { port.say(m); if (concern == DB.WriteConcern.STRICT) { return _checkWriteError(mp, port); } else { mp.done(port); return new WriteResult(db, port); } } catch (IOException ioe) { mp.error(ioe); _error(ioe); if (concern == DB.WriteConcern.NONE) { CommandResult res = new CommandResult(); res.put("ok", false); res.put("$err", "NETWORK ERROR"); return new WriteResult(res); } throw new MongoException.Network("can't say something", ioe); } catch (MongoException me) { throw me; } catch (RuntimeException re) { mp.error(re); throw re; } }