From 2a5a306ace92c00625558cb183912fba082837f4 Mon Sep 17 00:00:00 2001 From: Lev Date: Fri, 3 Sep 2021 23:23:57 -0500 Subject: [PATCH] Update --- .../Topic 4/11.2.7 Try and catch/exception.js | 13 +++++++++++++ .../Topic 4/11.2.9 Throw an exception/throw.js | 17 +++++++++++++++++ .../18.1.1 Git Basics}/Basic Git Commands.txt | 0 3 files changed, 30 insertions(+) create mode 100644 CM2010 Software Design and Development/Topic 4/11.2.7 Try and catch/exception.js create mode 100644 CM2010 Software Design and Development/Topic 4/11.2.9 Throw an exception/throw.js rename {CM2020 Agile Software Projects/Week 18 => CM2010 Software Design and Development/Topic 6/18.1.1 Git Basics}/Basic Git Commands.txt (100%) diff --git a/CM2010 Software Design and Development/Topic 4/11.2.7 Try and catch/exception.js b/CM2010 Software Design and Development/Topic 4/11.2.7 Try and catch/exception.js new file mode 100644 index 0000000..ee5f424 --- /dev/null +++ b/CM2010 Software Design and Development/Topic 4/11.2.7 Try and catch/exception.js @@ -0,0 +1,13 @@ +try +{ + verifyUser(); + console.log("After verifyUser"); +} +catch (exception) +{ + console.log("Exception caught"); + console.log("Name: " + exception.name); // Type of exception + console.log("Message: " + exception.message); +} + +console.log("I'm still running.."); \ No newline at end of file diff --git a/CM2010 Software Design and Development/Topic 4/11.2.9 Throw an exception/throw.js b/CM2010 Software Design and Development/Topic 4/11.2.9 Throw an exception/throw.js new file mode 100644 index 0000000..e07c272 --- /dev/null +++ b/CM2010 Software Design and Development/Topic 4/11.2.9 Throw an exception/throw.js @@ -0,0 +1,17 @@ +function verifyUser(username, password) +{ + // code here + throw{name:"DatabaseError", message: "Could not connect to database"} +} + +try +{ + verifyUser(); + console.log("After verifyUser"); +} +catch (exception) +{ + console.log("Exception caught"); + console.log("Name: " + exception.name); // Type of exception + console.log("Message: " + exception.message); +} \ No newline at end of file diff --git a/CM2020 Agile Software Projects/Week 18/Basic Git Commands.txt b/CM2010 Software Design and Development/Topic 6/18.1.1 Git Basics/Basic Git Commands.txt similarity index 100% rename from CM2020 Agile Software Projects/Week 18/Basic Git Commands.txt rename to CM2010 Software Design and Development/Topic 6/18.1.1 Git Basics/Basic Git Commands.txt