Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3317542
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:35:59+00:00 2026-05-17T22:35:59+00:00

This is a follow up to an older question . Given a ISBN number,

  • 0

This is a follow up to an older question.

Given a ISBN number, e.g. 3-528-03851-5 which exception type should I raise if the passed in string doesn’t match the format X-XXX-XXXXX-X?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T22:35:59+00:00Added an answer on May 17, 2026 at 10:35 pm

    Raise a ValueError.

    It’s pretty much the standard way of saying “you’ve given me a value that doesn’t make sense”. For example:

    >>> int("a")
    Traceback (most recent call last):
      File "", line 1, in 
    ValueError: invalid literal for int() with base 10: 'a'
    >>> import shlex; shlex.split("'")
    Traceback (most recent call last):
       ...
    ValueError: No closing quotation
    
    

    Contrast this with a TypeError, which is raised when a type is incorrect:

    >>> d = {}
    >>> d[{}]
    Traceback (most recent call last):
      File "", line 1, in 
    TypeError: unhashable type: 'dict'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a follow-up to a question I'd asked earlier which phrased this as
This is a follow on from another question i made I have this query
A follow-up on this system management question : Since I probably will not get
The most relevant question here on StackOverflow was this , which still doesn't answer
This question is a follow up to my earlier question: Creating a valid XSD
Follow-up of this so-question: if I have a shallow clone, how to fetch all
This is a follow-up question to this other one . I am trying to
This is a follow up to a previous question: Disparity between date/time calculations in
This is a follow up based on this question about query optimization . In
This follows on from this question: Algorithm to generate spanning set Given this input:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.