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