{"size": 1291, "ext": "js", "max_stars_repo_path": "week-6/wilsonA-exercise-6.2.js", "max_stars_repo_name": "VisionsICStudios/web-231", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "week-6/wilsonA-exercise-6.2.js", "max_issues_repo_name": "VisionsICStudios/web-231", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "week-6/wilsonA-exercise-6.2.js", "max_forks_repo_name": "VisionsICStudios/web-231", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.487804878, "max_line_length": 146, "alphanum_fraction": 0.6351665376}
/*
============================================
; Title:  wilsonA-exercise-6.2.js
; Author: Richard Krasso
; Date:   14 January 2019
; Modified By: Aaron Wilson
; Description: Create a try/catch/finally
; block.
;===========================================
*/

// Header info.
const header = require('./header.js');

// Output to the console the header info.
console.log(header.display('Aaron', 'Wilson', 'Exercise 6.2'));

// variables to pass to the try/catch.
let fun = 'a football';
let influenza;

const howsMyHealth = (sickness) => {

  // Create a try block that houses an if condition to check the passed in 'undefined' influenza variable as a parameter.
  try {
    if (sickness === undefined) throw 'Ewww! You\'re sick!! Your';

    // catch that error and display the throw output to the console.
  } catch (err) {
    sickness = 'The Flu';
    console.log(`Catch Clause: The Doc determined that... ${err} illness is in fact - ${sickness}!`);

    // Once the error has been determined, continue to execute the code in the console, to the program's end.
  } finally {
    console.log(`Now that the doctor has deemed you to be better, I'd rather you \"catch"\ ${fun}, then ${sickness}!\nFinally clause reached...`);
  }
}

// call the function for output.
howsMyHealth(influenza);
