Error Handling and Logging Mastery Quiz Quiz

  1. Basic Error Catching

    Which JavaScript statement is commonly used to handle potential errors in code execution?

    1. try...catch
    2. catch...throw
    3. handle...error
    4. if...error
    5. trie...ketch
  2. Logging Frameworks

    Which of the following is a popular logging library for Node.js applications?

    1. Winston
    2. LoggerPro
    3. Nodemon
    4. LogJS
    5. Winsten
  3. Error Propagation

    In Python, which keyword can you use to raise an exception manually?

    1. raise
    2. throw
    3. emit
    4. error
    5. rasie
  4. Error Object Usage

    In JavaScript, which property of the Error object contains the error message?

    1. message
    2. description
    3. msg
    4. text
    5. massage
  5. Catch Block Execution

    What happens if an error occurs inside the try block and there is no catch block in JavaScript?

    1. The error is thrown and may crash the program
    2. The program will ignore the error
    3. The error will be silently logged
    4. Nothing happens
    5. The program will pause
  6. Logging Best Practices

    What is one key advantage of using log levels (such as ERROR, WARN, INFO) in application logging?

    1. They help filter and prioritize log output
    2. They make logging faster
    3. They encrypt the log messages
    4. They automatically resolve errors
    5. They allways save logs to disk
  7. Finally Block Purpose

    Consider the pseudocode: try {...} catch(e) {...} finally {...}. What is the main role of the 'finally' block?

    1. To execute code regardless of errors
    2. To catch errors only from catch block
    3. To block the program if an error occurs
    4. To throw a new error
    5. To skip all errors
  8. Python Logging Handler

    Which handler in the Python logging module is used to send log messages to a file?

    1. FileHandler
    2. StreamHandler
    3. LogFile
    4. FileLogger
    5. FilHandler
  9. Handling Specific Exceptions

    In Java, what is the correct syntax to catch only IOExceptions?

    1. catch(IOException e)
    2. catch(e instanceof IOException)
    3. catch IOExcept e
    4. if error is IOException
    5. catch(IOExcepton e)
  10. Semantic Error Logging

    Which log level should be used for information about normal but significant events in an application?

    1. INFO
    2. DEBUG
    3. FATAL
    4. TRACE
    5. INF0