From d2a91553b8049b1e531b02c26660c9ace46de769 Mon Sep 17 00:00:00 2001 From: Marcus Ferl Date: Fri, 1 Apr 2022 21:26:06 +0200 Subject: [PATCH] =?UTF-8?q?=E2=80=9EFunktions/Json=5FParse=5FExample.cs?= =?UTF-8?q?=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Funktions/Json_Parse_Example.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Funktions/Json_Parse_Example.cs b/Funktions/Json_Parse_Example.cs index f64fdde..e68701f 100644 --- a/Funktions/Json_Parse_Example.cs +++ b/Funktions/Json_Parse_Example.cs @@ -13,8 +13,16 @@ class JsonParser // Get Data dynamic get_jsonData(string url) { + string json = ""; var webclient = new WebClient(); - string json = webclient.DownloadString(url); + try + { + json = webclient.DownloadString(url); + } + catch(WebException e) + { + throw e; + } dynamic dynJson = JsonConvert.DeserializeObject(json); return dynJson;