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