Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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 }