• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [High Spam] Re: Converting error codes to readable strings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [High Spam] Re: Converting error codes to readable strings?


  • Subject: Re: [High Spam] Re: Converting error codes to readable strings?
  • From: AgentM <email@hidden>
  • Date: Fri, 3 Feb 2006 10:03:32 -0600

Please allow me to flip the question around: Why would you want to tell the user that an "NSXMLParserTagNameMismatchError" occurred? Would they even know what it means? Even if you could glean it automatically from the header files (which you could do with macros), it most certainly wouldn't be localized or even localizable.

Instead, catch the most common errors and suggest what the solution could be. In this case, something along the lines of "The tags "<hello>" and "</helo>" in the XML file "hello.xml" are mismatched at line X." would be more appropriate.

On Feb 3, 2006, at 7:04 AM, Jonathan del Strother wrote:


On 3 Feb 2006, at 12:50, Camillo Lugaresi wrote:

On 02/feb/06, at 17:22, Jonathan del Strother wrote:

Is there any way to convert error enums into readable strings?

For example, the NSXMLParser might give me parse error number 76, and I have to go look that up to find that that corresponds to NSXMLParserTagNameMismatchError. Not very helpful for users who don't have the NSXMLParser.h header file...

I suppose I could produce my own switch statement to produce an error string for every NSXMLParserError enum value, but is there a better way?

NSError's localizedDescription method might help.


Sadly not - that just returns something along the lines of "NSXMLParserErrorDomain error 76"

|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|- AgentM email@hidden |-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Converting error codes to readable strings? (From: Jonathan del Strother <email@hidden>)
 >Re: Converting error codes to readable strings? (From: Camillo Lugaresi <email@hidden>)
 >Re: [High Spam] Re: Converting error codes to readable strings? (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: Notification of selection change/no selection from NSBrowser?
  • Next by Date: Re: Objective-C or Objective-C++
  • Previous by thread: Re: Converting error codes to readable strings?
  • Next by thread: Preferred hight of NSTextField
  • Index(es):
    • Date
    • Thread