private static string addArticulo(DBStorage db, string message) { Articulo articulo; try { articulo = (Articulo)JsonConvert.DeserializeObject(message, typeof(Articulo)); } catch (Exception) { return("ERR"); } if (articulo == null || !articulo.isValid()) { return("ERR"); } return(db.addArticulo(articulo) ? "OK" : "ERR"); }