Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Error Handling in Swift 2.0 Error Handling Throwing Errors

This question is asking me to through an argument but seems like i already have... thoughts anyone? enum NetworkError

enum NetworkError: ErrorType{ case InvalidURL }

func lend()throws { throw NetworkError.InvalidURL }

error.swift
enum NetworkError: ErrorType{
    case InvalidURL
}

func lend()throws {
    throw NetworkError.InvalidURL
}

1 Answer

Keli'i Martin
Keli'i Martin
8,227 Points

Hmm... The challenge that this question is linked to seems to be asking for a completely different error type. This is the code I am given at the start of the challenge:

enum BookError: ErrorType {
  case IncorrectTitle
}

Thank you so much that was the issue maybe a glitch i kept refreshing but i solved it as if it asked me what you saw and that worked!!!!

enum BookError: ErrorType { case IncorrectTitle }

func lend()throws { throw BookError.IncorrectTitle }