[{"data":1,"prerenderedAt":4828},["ShallowReactive",2],{"tutorials-python-how-to":3,"category-items-python-how-to":600,"content-/python-how-to/create-custom-exceptions":601},[4,22,31,40,49,58,67,76,86,94,103,112,121,130,139,148,158,167,176,185,194,203,212,222,231,240,249,258,267,276,285,297,306,315,324,333,342,351,362,371,380,389,398,407,418,427,436,445,454,463,472,483,492,501,510,519,528,539,548,557,566,575,584,593],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"slug":11,"order":12,"isParent":13,"icon":14,"_type":15,"_id":16,"_source":17,"_file":18,"_stem":19,"_extension":20,"children":21,"expanded":13},"/python-how-to/string-manipulation","python-how-to",false,"","String Manipulation","Learn essential string manipulation techniques in Python","string-manipulation",1,true,"pi pi-folder","markdown","content:python-how-to:1.string-manipulation.md","content","python-how-to/1.string-manipulation.md","python-how-to/1.string-manipulation","md",[22,31,40,49,58,67],{"_path":23,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":24,"description":25,"slug":26,"parentId":5,"order":27,"_type":15,"_id":28,"_source":17,"_file":29,"_stem":30,"_extension":20},"/python-how-to/split-join-strings","Split and Join Strings","Learn how to split strings into lists and join lists back into strings in Python","split-join-strings",2,"content:python-how-to:2.split-join-strings.md","python-how-to/2.split-join-strings.md","python-how-to/2.split-join-strings",{"_path":32,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":33,"description":34,"slug":35,"parentId":5,"order":36,"_type":15,"_id":37,"_source":17,"_file":38,"_stem":39,"_extension":20},"/python-how-to/remove-whitespace","Remove Whitespace","Learn how to clean up and remove unwanted whitespace from strings in Python","remove-whitespace",3,"content:python-how-to:3.remove-whitespace.md","python-how-to/3.remove-whitespace.md","python-how-to/3.remove-whitespace",{"_path":41,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":42,"description":43,"slug":44,"parentId":5,"order":45,"_type":15,"_id":46,"_source":17,"_file":47,"_stem":48,"_extension":20},"/python-how-to/find-replace-text","Find and Replace Text","Learn how to search for and replace text within strings in Python","find-replace-text",4,"content:python-how-to:4.find-replace-text.md","python-how-to/4.find-replace-text.md","python-how-to/4.find-replace-text",{"_path":50,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":51,"description":52,"slug":53,"parentId":5,"order":54,"_type":15,"_id":55,"_source":17,"_file":56,"_stem":57,"_extension":20},"/python-how-to/check-string-content","Check String Content","Learn how to validate and check the content of strings in Python","check-string-content",5,"content:python-how-to:5.check-string-content.md","python-how-to/5.check-string-content.md","python-how-to/5.check-string-content",{"_path":59,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":60,"description":61,"slug":62,"parentId":5,"order":63,"_type":15,"_id":64,"_source":17,"_file":65,"_stem":66,"_extension":20},"/python-how-to/format-strings","Format Strings","Learn how to format strings in Python using f-strings and format() method","format-strings",6,"content:python-how-to:6.format-strings.md","python-how-to/6.format-strings.md","python-how-to/6.format-strings",{"_path":68,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":69,"description":70,"slug":71,"parentId":5,"order":72,"_type":15,"_id":73,"_source":17,"_file":74,"_stem":75,"_extension":20},"/python-how-to/unicode-special-chars","Handle Unicode and Special Characters","Learn how to work with Unicode and special characters in Python strings","unicode-special-chars",7,"content:python-how-to:7.unicode-special-chars.md","python-how-to/7.unicode-special-chars.md","python-how-to/7.unicode-special-chars",{"_path":77,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":78,"description":79,"slug":80,"order":81,"isParent":13,"icon":14,"_type":15,"_id":82,"_source":17,"_file":83,"_stem":84,"_extension":20,"children":85,"expanded":13},"/python-how-to/list-operations","List Operations","Learn essential operations for working with lists in Python","list-operations",8,"content:python-how-to:8.list-operations.md","python-how-to/8.list-operations.md","python-how-to/8.list-operations",[86,94,103,112,121,130,139],{"_path":87,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":88,"description":89,"slug":90,"parentId":77,"order":81,"_type":15,"_id":91,"_source":17,"_file":92,"_stem":93,"_extension":20},"/python-how-to/sort-lists","Sort Lists","Learn how to sort lists in Python using different methods and custom sorting","sort-lists","content:python-how-to:9.sort-lists.md","python-how-to/9.sort-lists.md","python-how-to/9.sort-lists",{"_path":95,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":96,"description":97,"slug":98,"parentId":77,"order":99,"_type":15,"_id":100,"_source":17,"_file":101,"_stem":102,"_extension":20},"/python-how-to/remove-duplicates","Remove Duplicates","Learn how to remove duplicate elements from lists in Python","remove-duplicates",10,"content:python-how-to:10.remove-duplicates.md","python-how-to/10.remove-duplicates.md","python-how-to/10.remove-duplicates",{"_path":104,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":105,"description":106,"slug":107,"parentId":77,"order":108,"_type":15,"_id":109,"_source":17,"_file":110,"_stem":111,"_extension":20},"/python-how-to/filter-lists","Filter Lists","Learn how to filter lists in Python using different methods","filter-lists",11,"content:python-how-to:11.filter-lists.md","python-how-to/11.filter-lists.md","python-how-to/11.filter-lists",{"_path":113,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":114,"description":115,"slug":116,"parentId":77,"order":117,"_type":15,"_id":118,"_source":17,"_file":119,"_stem":120,"_extension":20},"/python-how-to/combine-lists","Combine Lists","Learn different methods to combine lists in Python","combine-lists",12,"content:python-how-to:12.combine-lists.md","python-how-to/12.combine-lists.md","python-how-to/12.combine-lists",{"_path":122,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":123,"description":124,"slug":125,"parentId":77,"order":126,"_type":15,"_id":127,"_source":17,"_file":128,"_stem":129,"_extension":20},"/python-how-to/list-comprehensions","Use List Comprehensions","Learn how to create and transform lists efficiently using Python's list comprehension syntax","list-comprehensions",13,"content:python-how-to:13.list-comprehensions.md","python-how-to/13.list-comprehensions.md","python-how-to/13.list-comprehensions",{"_path":131,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":132,"description":133,"slug":134,"parentId":77,"order":135,"_type":15,"_id":136,"_source":17,"_file":137,"_stem":138,"_extension":20},"/python-how-to/nested-lists","Work with Nested Lists","Learn how to work with nested lists (2D arrays) in Python","nested-lists",14,"content:python-how-to:14.nested-lists.md","python-how-to/14.nested-lists.md","python-how-to/14.nested-lists",{"_path":140,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":141,"description":142,"slug":143,"parentId":77,"order":144,"_type":15,"_id":145,"_source":17,"_file":146,"_stem":147,"_extension":20},"/python-how-to/enumerate-zip","Use enumerate() and zip()","Learn how to use enumerate() and zip() for efficient iteration in Python","enumerate-zip",15,"content:python-how-to:15.enumerate-zip.md","python-how-to/15.enumerate-zip.md","python-how-to/15.enumerate-zip",{"_path":149,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":150,"description":151,"slug":152,"order":153,"isParent":13,"icon":14,"_type":15,"_id":154,"_source":17,"_file":155,"_stem":156,"_extension":20,"children":157,"expanded":13},"/python-how-to/dictionary-operations","Dictionary Operations","Learn essential operations for working with dictionaries in Python","dictionary-operations",16,"content:python-how-to:16.dictionary-operations.md","python-how-to/16.dictionary-operations.md","python-how-to/16.dictionary-operations",[158,167,176,185,194,203],{"_path":159,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":160,"description":161,"slug":162,"parentId":149,"order":163,"_type":15,"_id":164,"_source":17,"_file":165,"_stem":166,"_extension":20},"/python-how-to/merge-dictionaries","Merge Dictionaries","Learn different methods to merge dictionaries in Python","merge-dictionaries",17,"content:python-how-to:17.merge-dictionaries.md","python-how-to/17.merge-dictionaries.md","python-how-to/17.merge-dictionaries",{"_path":168,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":169,"description":170,"slug":171,"parentId":149,"order":172,"_type":15,"_id":173,"_source":17,"_file":174,"_stem":175,"_extension":20},"/python-how-to/sort-dictionaries","Sort Dictionaries","Learn how to sort dictionaries by keys or values in Python","sort-dictionaries",18,"content:python-how-to:18.sort-dictionaries.md","python-how-to/18.sort-dictionaries.md","python-how-to/18.sort-dictionaries",{"_path":177,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":178,"description":179,"slug":180,"parentId":149,"order":181,"_type":15,"_id":182,"_source":17,"_file":183,"_stem":184,"_extension":20},"/python-how-to/filter-dictionaries","Filter Dictionaries","Learn how to filter dictionaries based on keys or values in Python","filter-dictionaries",19,"content:python-how-to:19.filter-dictionaries.md","python-how-to/19.filter-dictionaries.md","python-how-to/19.filter-dictionaries",{"_path":186,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":187,"description":188,"slug":189,"parentId":149,"order":190,"_type":15,"_id":191,"_source":17,"_file":192,"_stem":193,"_extension":20},"/python-how-to/handle-missing-keys","Handle Missing Keys","Learn safe ways to access dictionary keys and handle missing values","handle-missing-keys",20,"content:python-how-to:20.handle-missing-keys.md","python-how-to/20.handle-missing-keys.md","python-how-to/20.handle-missing-keys",{"_path":195,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":196,"description":197,"slug":198,"parentId":149,"order":199,"_type":15,"_id":200,"_source":17,"_file":201,"_stem":202,"_extension":20},"/python-how-to/dictionary-comprehensions","Use Dictionary Comprehensions","Learn how to create dictionaries efficiently using comprehensions","dictionary-comprehensions",21,"content:python-how-to:21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions.md","python-how-to/21.dictionary-comprehensions",{"_path":204,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":205,"description":206,"slug":207,"parentId":149,"order":208,"_type":15,"_id":209,"_source":17,"_file":210,"_stem":211,"_extension":20},"/python-how-to/convert-lists-dictionaries","Convert Between Lists and Dictionaries","Learn how to transform data between lists and dictionaries in Python","convert-lists-dictionaries",22,"content:python-how-to:22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries.md","python-how-to/22.convert-lists-dictionaries",{"_path":213,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":214,"description":215,"slug":216,"order":217,"isParent":13,"icon":14,"_type":15,"_id":218,"_source":17,"_file":219,"_stem":220,"_extension":20,"children":221,"expanded":13},"/python-how-to/file-operations","File Operations","Learn essential file operations in Python for reading, writing, and managing files","file-operations",23,"content:python-how-to:23.file-operations.md","python-how-to/23.file-operations.md","python-how-to/23.file-operations",[222,231,240,249,258,267,276],{"_path":223,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":224,"description":225,"slug":226,"parentId":213,"order":227,"_type":15,"_id":228,"_source":17,"_file":229,"_stem":230,"_extension":20},"/python-how-to/read-text-files","Read Text Files","Learn how to read text files in Python using different methods","read-text-files",24,"content:python-how-to:24.read-text-files.md","python-how-to/24.read-text-files.md","python-how-to/24.read-text-files",{"_path":232,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":233,"description":234,"slug":235,"parentId":213,"order":236,"_type":15,"_id":237,"_source":17,"_file":238,"_stem":239,"_extension":20},"/python-how-to/write-to-files","Write to Files","Learn how to write and create files in Python using different methods","write-to-files",25,"content:python-how-to:25.write-to-files.md","python-how-to/25.write-to-files.md","python-how-to/25.write-to-files",{"_path":241,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":242,"description":243,"slug":244,"parentId":213,"order":245,"_type":15,"_id":246,"_source":17,"_file":247,"_stem":248,"_extension":20},"/python-how-to/work-csv-files","Work with CSV Files","Learn how to read and write CSV files in Python using the csv module","work-csv-files",26,"content:python-how-to:26.work-csv-files.md","python-how-to/26.work-csv-files.md","python-how-to/26.work-csv-files",{"_path":250,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":251,"description":252,"slug":253,"parentId":213,"order":254,"_type":15,"_id":255,"_source":17,"_file":256,"_stem":257,"_extension":20},"/python-how-to/handle-file-paths","Handle File Paths","Learn how to work with file and directory paths in Python using pathlib and os modules","handle-file-paths",27,"content:python-how-to:27.handle-file-paths.md","python-how-to/27.handle-file-paths.md","python-how-to/27.handle-file-paths",{"_path":259,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":260,"description":261,"slug":262,"parentId":213,"order":263,"_type":15,"_id":264,"_source":17,"_file":265,"_stem":266,"_extension":20},"/python-how-to/work-json-files","Work with JSON Files","Learn how to read and write JSON files in Python using the json module","work-json-files",28,"content:python-how-to:28.work-json-files.md","python-how-to/28.work-json-files.md","python-how-to/28.work-json-files",{"_path":268,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":269,"description":270,"slug":271,"parentId":213,"order":272,"_type":15,"_id":273,"_source":17,"_file":274,"_stem":275,"_extension":20},"/python-how-to/handle-binary-files","Handle Binary Files","Learn how to work with binary files in Python for images, data, and other non-text content","handle-binary-files",29,"content:python-how-to:29.handle-binary-files.md","python-how-to/29.handle-binary-files.md","python-how-to/29.handle-binary-files",{"_path":277,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":278,"description":279,"slug":280,"parentId":213,"order":281,"_type":15,"_id":282,"_source":17,"_file":283,"_stem":284,"_extension":20},"/python-how-to/use-context-managers","Use Context Managers","Learn how to use context managers for safe resource handling in Python","use-context-managers",30,"content:python-how-to:30.use-context-managers.md","python-how-to/30.use-context-managers.md","python-how-to/30.use-context-managers",{"_path":286,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":287,"description":288,"slug":289,"parentId":290,"order":291,"isParent":13,"icon":292,"_type":15,"_id":293,"_source":17,"_file":294,"_stem":295,"_extension":20,"children":296,"expanded":13},"/python-how-to/date-and-time","Date and Time","Master Python's date and time handling with datetime, time zones, formatting, and calculations","date-and-time","/python-how-to",31,"pi pi-calendar","content:python-how-to:31.date-and-time.md","python-how-to/31.date-and-time.md","python-how-to/31.date-and-time",[297,306,315,324,333,342],{"_path":298,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":299,"description":300,"slug":301,"parentId":286,"order":302,"_type":15,"_id":303,"_source":17,"_file":304,"_stem":305,"_extension":20},"/python-how-to/get-current-datetime","Get Current Date/Time","Learn how to get current date, time, and timestamps using Python's datetime module","get-current-datetime",32,"content:python-how-to:32.get-current-datetime.md","python-how-to/32.get-current-datetime.md","python-how-to/32.get-current-datetime",{"_path":307,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":308,"description":309,"slug":310,"parentId":286,"order":311,"_type":15,"_id":312,"_source":17,"_file":313,"_stem":314,"_extension":20},"/python-how-to/format-dates","Format Dates","Master date formatting with strftime, custom formats, and locale-aware formatting for user-friendly displays","format-dates",33,"content:python-how-to:33.format-dates.md","python-how-to/33.format-dates.md","python-how-to/33.format-dates",{"_path":316,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":317,"description":318,"slug":319,"parentId":286,"order":320,"_type":15,"_id":321,"_source":17,"_file":322,"_stem":323,"_extension":20},"/python-how-to/calculate-date-differences","Calculate Date Differences","Learn to calculate time differences, durations, and intervals using Python's timedelta for scheduling and analytics","calculate-date-differences",34,"content:python-how-to:34.calculate-date-differences.md","python-how-to/34.calculate-date-differences.md","python-how-to/34.calculate-date-differences",{"_path":325,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":326,"description":327,"slug":328,"parentId":286,"order":329,"_type":15,"_id":330,"_source":17,"_file":331,"_stem":332,"_extension":20},"/python-how-to/parse-date-strings","Parse Date Strings","Convert text dates into Python datetime objects using strptime, handle multiple formats, and validate date input","parse-date-strings",35,"content:python-how-to:35.parse-date-strings.md","python-how-to/35.parse-date-strings.md","python-how-to/35.parse-date-strings",{"_path":334,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":335,"description":336,"slug":337,"parentId":286,"order":338,"_type":15,"_id":339,"_source":17,"_file":340,"_stem":341,"_extension":20},"/python-how-to/handle-timezones","Handle Timezones","Master timezone handling with zoneinfo, UTC conversions, and timezone-aware datetime objects for global applications","handle-timezones",36,"content:python-how-to:36.handle-timezones.md","python-how-to/36.handle-timezones.md","python-how-to/36.handle-timezones",{"_path":343,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":344,"description":345,"slug":346,"parentId":286,"order":347,"_type":15,"_id":348,"_source":17,"_file":349,"_stem":350,"_extension":20},"/python-how-to/work-with-timestamps","Work with Timestamps","Master Unix timestamps in Python - convert between datetime objects and timestamps for APIs, databases, and system integration","work-with-timestamps",37,"content:python-how-to:37.work-with-timestamps.md","python-how-to/37.work-with-timestamps.md","python-how-to/37.work-with-timestamps",{"_path":352,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":353,"description":354,"slug":355,"parentId":290,"order":356,"isParent":13,"icon":357,"_type":15,"_id":358,"_source":17,"_file":359,"_stem":360,"_extension":20,"children":361,"expanded":13},"/python-how-to/error-handling","Error Handling","Learn Python's error handling with try/except, custom exceptions, debugging, logging, and retry logic for robust applications","error-handling",38,"pi pi-exclamation-triangle","content:python-how-to:38.error-handling.md","python-how-to/38.error-handling.md","python-how-to/38.error-handling",[362,371,380,389,398],{"_path":363,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":364,"description":365,"slug":366,"parentId":352,"order":367,"_type":15,"_id":368,"_source":17,"_file":369,"_stem":370,"_extension":20},"/python-how-to/handle-exceptions","Handle Exceptions","Master try/except blocks, multiple exception handling, and finally clauses for robust error handling in Python","handle-exceptions",39,"content:python-how-to:39.handle-exceptions.md","python-how-to/39.handle-exceptions.md","python-how-to/39.handle-exceptions",{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},"/python-how-to/create-custom-exceptions","Create Custom Exceptions","Learn to create custom exception classes in Python for specific error handling and better code organization","create-custom-exceptions",40,"content:python-how-to:40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions.md","python-how-to/40.create-custom-exceptions",{"_path":381,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":382,"description":383,"slug":384,"parentId":352,"order":385,"_type":15,"_id":386,"_source":17,"_file":387,"_stem":388,"_extension":20},"/python-how-to/debug-code","Debug Code","Learn Python debugging techniques using print statements, the debugger, and tools to find and fix code issues","debug-code",41,"content:python-how-to:41.debug-code.md","python-how-to/41.debug-code.md","python-how-to/41.debug-code",{"_path":390,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":391,"description":392,"slug":393,"parentId":352,"order":394,"_type":15,"_id":395,"_source":17,"_file":396,"_stem":397,"_extension":20},"/python-how-to/use-logging","Use Logging","Learn Python's logging module for tracking application behavior, errors, and debugging information","use-logging",42,"content:python-how-to:42.use-logging.md","python-how-to/42.use-logging.md","python-how-to/42.use-logging",{"_path":399,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":400,"description":401,"slug":402,"parentId":352,"order":403,"_type":15,"_id":404,"_source":17,"_file":405,"_stem":406,"_extension":20},"/python-how-to/implement-retry-logic","Implement Retry Logic","Learn to implement retry mechanisms in Python for handling temporary failures and building resilient applications","implement-retry-logic",43,"content:python-how-to:43.implement-retry-logic.md","python-how-to/43.implement-retry-logic.md","python-how-to/43.implement-retry-logic",{"_path":408,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":409,"description":410,"slug":411,"parentId":290,"order":412,"isParent":13,"icon":413,"_type":15,"_id":414,"_source":17,"_file":415,"_stem":416,"_extension":20,"children":417},"/python-how-to/functions-and-modules","Functions and Modules","Learn Python functions, modules, and code organization for building reusable, maintainable applications","functions-and-modules",44,"pi pi-box","content:python-how-to:44.functions-and-modules.md","python-how-to/44.functions-and-modules.md","python-how-to/44.functions-and-modules",[418,427,436,445,454,463],{"_path":419,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":420,"description":421,"slug":422,"parentId":408,"order":423,"_type":15,"_id":424,"_source":17,"_file":425,"_stem":426,"_extension":20},"/python-how-to/write-functions","Write Functions","Learn to create Python functions with parameters, return values, and documentation for reusable code","write-functions",45,"content:python-how-to:45.write-functions.md","python-how-to/45.write-functions.md","python-how-to/45.write-functions",{"_path":428,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":429,"description":430,"slug":431,"parentId":408,"order":432,"_type":15,"_id":433,"_source":17,"_file":434,"_stem":435,"_extension":20},"/python-how-to/use-args-kwargs","Use *args and **kwargs","Learn to use *args and **kwargs for flexible function arguments in Python","use-args-kwargs",46,"content:python-how-to:46.use-args-kwargs.md","python-how-to/46.use-args-kwargs.md","python-how-to/46.use-args-kwargs",{"_path":437,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":438,"description":439,"slug":440,"parentId":408,"order":441,"_type":15,"_id":442,"_source":17,"_file":443,"_stem":444,"_extension":20},"/python-how-to/create-decorators","Create Decorators","Learn to create and use Python decorators to enhance function behavior and add functionality","create-decorators",47,"content:python-how-to:47.create-decorators.md","python-how-to/47.create-decorators.md","python-how-to/47.create-decorators",{"_path":446,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":447,"description":448,"slug":449,"parentId":408,"order":450,"_type":15,"_id":451,"_source":17,"_file":452,"_stem":453,"_extension":20},"/python-how-to/use-generators","Use Generators","Learn to create memory-efficient generators with yield for processing large datasets and sequences","use-generators",48,"content:python-how-to:48.use-generators.md","python-how-to/48.use-generators.md","python-how-to/48.use-generators",{"_path":455,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":456,"description":457,"slug":458,"parentId":408,"order":459,"_type":15,"_id":460,"_source":17,"_file":461,"_stem":462,"_extension":20},"/python-how-to/work-modules-packages","Work with Modules and Packages","Learn to organize Python code with modules and packages, and use imports effectively","work-modules-packages",49,"content:python-how-to:49.work-modules-packages.md","python-how-to/49.work-modules-packages.md","python-how-to/49.work-modules-packages",{"_path":464,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":465,"description":466,"slug":467,"parentId":408,"order":468,"_type":15,"_id":469,"_source":17,"_file":470,"_stem":471,"_extension":20},"/python-how-to/create-virtual-environments","Create Virtual Environments","Learn to create and manage Python virtual environments for project dependency isolation","create-virtual-environments",50,"content:python-how-to:50.create-virtual-environments.md","python-how-to/50.create-virtual-environments.md","python-how-to/50.create-virtual-environments",{"_path":473,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":474,"description":475,"slug":476,"parentId":290,"order":477,"isParent":13,"icon":478,"_type":15,"_id":479,"_source":17,"_file":480,"_stem":481,"_extension":20,"children":482},"/python-how-to/data-processing","Data Processing","Learn Python data processing techniques including regex, APIs, databases, and large file handling","data-processing",51,"pi pi-database","content:python-how-to:51.data-processing.md","python-how-to/51.data-processing.md","python-how-to/51.data-processing",[483,492,501,510,519],{"_path":484,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":485,"description":486,"slug":487,"parentId":473,"order":488,"_type":15,"_id":489,"_source":17,"_file":490,"_stem":491,"_extension":20},"/python-how-to/work-regular-expressions","Work with Regular Expressions","Learn to use Python's re module for pattern matching, text extraction, and data validation","work-regular-expressions",52,"content:python-how-to:52.work-regular-expressions.md","python-how-to/52.work-regular-expressions.md","python-how-to/52.work-regular-expressions",{"_path":493,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":494,"description":495,"slug":496,"parentId":473,"order":497,"_type":15,"_id":498,"_source":17,"_file":499,"_stem":500,"_extension":20},"/python-how-to/parse-xml-html","Parse XML and HTML","Learn to extract data from XML and HTML documents using Python's built-in parsing tools","parse-xml-html",53,"content:python-how-to:53.parse-xml-html.md","python-how-to/53.parse-xml-html.md","python-how-to/53.parse-xml-html",{"_path":502,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":503,"description":504,"slug":505,"parentId":473,"order":506,"_type":15,"_id":507,"_source":17,"_file":508,"_stem":509,"_extension":20},"/python-how-to/handle-api-requests","Handle API Requests","Learn to fetch and process data from web APIs using Python's urllib and external requests library","handle-api-requests",54,"content:python-how-to:54.handle-api-requests.md","python-how-to/54.handle-api-requests.md","python-how-to/54.handle-api-requests",{"_path":511,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":512,"description":513,"slug":514,"parentId":473,"order":515,"_type":15,"_id":516,"_source":17,"_file":517,"_stem":518,"_extension":20},"/python-how-to/work-databases","Work with Databases","Learn to connect to and query SQL databases using Python's sqlite3 and database techniques","work-databases",55,"content:python-how-to:55.work-databases.md","python-how-to/55.work-databases.md","python-how-to/55.work-databases",{"_path":520,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":521,"description":522,"slug":523,"parentId":473,"order":524,"_type":15,"_id":525,"_source":17,"_file":526,"_stem":527,"_extension":20},"/python-how-to/process-large-files","Process Large Files","Learn memory-efficient techniques for handling large files and datasets in Python","process-large-files",56,"content:python-how-to:56.process-large-files.md","python-how-to/56.process-large-files.md","python-how-to/56.process-large-files",{"_path":529,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":530,"description":531,"slug":532,"parentId":290,"order":533,"isParent":13,"icon":534,"_type":15,"_id":535,"_source":17,"_file":536,"_stem":537,"_extension":20,"children":538},"/python-how-to/best-practices","Best Practices","Learn Python best practices for writing clean, maintainable, and efficient code","best-practices",57,"pi pi-star","content:python-how-to:57.best-practices.md","python-how-to/57.best-practices.md","python-how-to/57.best-practices",[539,548,557,566,575,584],{"_path":540,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":541,"description":542,"slug":543,"parentId":529,"order":544,"_type":15,"_id":545,"_source":17,"_file":546,"_stem":547,"_extension":20},"/python-how-to/structure-code","Structure Your Code","Learn to organize Python code with proper module structure, functions, and classes","structure-code",58,"content:python-how-to:58.structure-code.md","python-how-to/58.structure-code.md","python-how-to/58.structure-code",{"_path":549,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":550,"description":551,"slug":552,"parentId":529,"order":553,"_type":15,"_id":554,"_source":17,"_file":555,"_stem":556,"_extension":20},"/python-how-to/write-clean-code","Write Clean Code","Learn to write readable, maintainable Python code with proper naming, comments, and clear logic","write-clean-code",59,"content:python-how-to:59.write-clean-code.md","python-how-to/59.write-clean-code.md","python-how-to/59.write-clean-code",{"_path":558,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":559,"description":560,"slug":561,"parentId":529,"order":562,"_type":15,"_id":563,"_source":17,"_file":564,"_stem":565,"_extension":20},"/python-how-to/optimize-performance","Optimize Performance","Learn to identify and fix performance bottlenecks in Python code for faster execution","optimize-performance",60,"content:python-how-to:60.optimize-performance.md","python-how-to/60.optimize-performance.md","python-how-to/60.optimize-performance",{"_path":567,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":568,"description":569,"slug":570,"parentId":529,"order":571,"_type":15,"_id":572,"_source":17,"_file":573,"_stem":574,"_extension":20},"/python-how-to/write-unit-tests","Write Unit Tests","Learn to create reliable unit tests to verify your Python code works correctly and catch bugs early","write-unit-tests",61,"content:python-how-to:61.write-unit-tests.md","python-how-to/61.write-unit-tests.md","python-how-to/61.write-unit-tests",{"_path":576,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":577,"description":578,"slug":579,"parentId":529,"order":580,"_type":15,"_id":581,"_source":17,"_file":582,"_stem":583,"_extension":20},"/python-how-to/document-code","Document Your Code","Learn to write clear documentation and helpful comments for your Python code","document-code",62,"content:python-how-to:62.document-code.md","python-how-to/62.document-code.md","python-how-to/62.document-code",{"_path":585,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":586,"description":587,"slug":588,"parentId":529,"order":589,"_type":15,"_id":590,"_source":17,"_file":591,"_stem":592,"_extension":20},"/python-how-to/use-type-hints","Use Type Hints","Learn to add type annotations to Python code for better clarity, tooling support, and error detection","use-type-hints",63,"content:python-how-to:63.use-type-hints.md","python-how-to/63.use-type-hints.md","python-how-to/63.use-type-hints",{"_path":290,"_dir":8,"_draft":7,"_partial":7,"_locale":8,"title":594,"description":595,"slug":6,"order":596,"icon":14,"_type":15,"_id":597,"_source":17,"_file":598,"_stem":599,"_extension":20,"expanded":13},"Python How-To Guide","Practical Python tutorials for common programming tasks. Learn step-by-step solutions for string manipulation, file operations, data processing, and more with real-world examples.",0,"content:python-how-to:index.md","python-how-to/index.md","python-how-to/index",[371],{"_path":372,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":373,"description":374,"slug":375,"parentId":352,"order":376,"body":602,"_type":15,"_id":377,"_source":17,"_file":378,"_stem":379,"_extension":20},{"type":603,"children":604,"toc":4809},"root",[605,614,620,951,958,963,1050,1057,1539,1545,2146,2152,2654,2660,2781,2787,2793,3383,3389,4040,4046,4418,4424,4430,4559,4565,4656,4662,4778,4784,4789,4803],{"type":606,"tag":607,"props":608,"children":610},"element","h1",{"id":609},"creating-custom-exceptions",[611],{"type":612,"value":613},"text","⚡ Creating Custom Exceptions",{"type":606,"tag":615,"props":616,"children":617},"p",{},[618],{"type":612,"value":619},"Custom exceptions help you create specific error types for your applications. They make error handling more precise and provide better context about what went wrong.",{"type":606,"tag":621,"props":622,"children":623},"code-try",{},[624],{"type":606,"tag":625,"props":626,"children":630},"pre",{"className":627,"code":628,"language":629,"meta":8,"style":8},"language-python shiki shiki-themes github-light github-dark","# Simple custom exception\nclass ValidationError(Exception):\n    pass\n\n# Using custom exception\ndef validate_age(age):\n    if age \u003C 0:\n        raise ValidationError(\"Age cannot be negative\")\n    if age > 150:\n        raise ValidationError(\"Age seems unrealistic\")\n    return age\n\ntry:\n    age = validate_age(-5)\nexcept ValidationError as e:\n    print(f\"Validation failed: {e}\")\n","python",[631],{"type":606,"tag":632,"props":633,"children":634},"code",{"__ignoreMap":8},[635,646,678,686,694,702,720,748,772,798,818,831,838,850,882,905],{"type":606,"tag":636,"props":637,"children":639},"span",{"class":638,"line":12},"line",[640],{"type":606,"tag":636,"props":641,"children":643},{"style":642},"--shiki-default:#6A737D;--shiki-app-dark-mode:#6A737D",[644],{"type":612,"value":645},"# Simple custom exception\n",{"type":606,"tag":636,"props":647,"children":648},{"class":638,"line":27},[649,655,661,667,673],{"type":606,"tag":636,"props":650,"children":652},{"style":651},"--shiki-default:#D73A49;--shiki-app-dark-mode:#F97583",[653],{"type":612,"value":654},"class",{"type":606,"tag":636,"props":656,"children":658},{"style":657},"--shiki-default:#6F42C1;--shiki-app-dark-mode:#B392F0",[659],{"type":612,"value":660}," ValidationError",{"type":606,"tag":636,"props":662,"children":664},{"style":663},"--shiki-default:#24292E;--shiki-app-dark-mode:#E1E4E8",[665],{"type":612,"value":666},"(",{"type":606,"tag":636,"props":668,"children":670},{"style":669},"--shiki-default:#005CC5;--shiki-app-dark-mode:#79B8FF",[671],{"type":612,"value":672},"Exception",{"type":606,"tag":636,"props":674,"children":675},{"style":663},[676],{"type":612,"value":677},"):\n",{"type":606,"tag":636,"props":679,"children":680},{"class":638,"line":36},[681],{"type":606,"tag":636,"props":682,"children":683},{"style":651},[684],{"type":612,"value":685},"    pass\n",{"type":606,"tag":636,"props":687,"children":688},{"class":638,"line":45},[689],{"type":606,"tag":636,"props":690,"children":691},{"emptyLinePlaceholder":13},[692],{"type":612,"value":693},"\n",{"type":606,"tag":636,"props":695,"children":696},{"class":638,"line":54},[697],{"type":606,"tag":636,"props":698,"children":699},{"style":642},[700],{"type":612,"value":701},"# Using custom exception\n",{"type":606,"tag":636,"props":703,"children":704},{"class":638,"line":63},[705,710,715],{"type":606,"tag":636,"props":706,"children":707},{"style":651},[708],{"type":612,"value":709},"def",{"type":606,"tag":636,"props":711,"children":712},{"style":657},[713],{"type":612,"value":714}," validate_age",{"type":606,"tag":636,"props":716,"children":717},{"style":663},[718],{"type":612,"value":719},"(age):\n",{"type":606,"tag":636,"props":721,"children":722},{"class":638,"line":72},[723,728,733,738,743],{"type":606,"tag":636,"props":724,"children":725},{"style":651},[726],{"type":612,"value":727},"    if",{"type":606,"tag":636,"props":729,"children":730},{"style":663},[731],{"type":612,"value":732}," age ",{"type":606,"tag":636,"props":734,"children":735},{"style":651},[736],{"type":612,"value":737},"\u003C",{"type":606,"tag":636,"props":739,"children":740},{"style":669},[741],{"type":612,"value":742}," 0",{"type":606,"tag":636,"props":744,"children":745},{"style":663},[746],{"type":612,"value":747},":\n",{"type":606,"tag":636,"props":749,"children":750},{"class":638,"line":81},[751,756,761,767],{"type":606,"tag":636,"props":752,"children":753},{"style":651},[754],{"type":612,"value":755},"        raise",{"type":606,"tag":636,"props":757,"children":758},{"style":663},[759],{"type":612,"value":760}," ValidationError(",{"type":606,"tag":636,"props":762,"children":764},{"style":763},"--shiki-default:#032F62;--shiki-app-dark-mode:#9ECBFF",[765],{"type":612,"value":766},"\"Age cannot be negative\"",{"type":606,"tag":636,"props":768,"children":769},{"style":663},[770],{"type":612,"value":771},")\n",{"type":606,"tag":636,"props":773,"children":775},{"class":638,"line":774},9,[776,780,784,789,794],{"type":606,"tag":636,"props":777,"children":778},{"style":651},[779],{"type":612,"value":727},{"type":606,"tag":636,"props":781,"children":782},{"style":663},[783],{"type":612,"value":732},{"type":606,"tag":636,"props":785,"children":786},{"style":651},[787],{"type":612,"value":788},">",{"type":606,"tag":636,"props":790,"children":791},{"style":669},[792],{"type":612,"value":793}," 150",{"type":606,"tag":636,"props":795,"children":796},{"style":663},[797],{"type":612,"value":747},{"type":606,"tag":636,"props":799,"children":800},{"class":638,"line":99},[801,805,809,814],{"type":606,"tag":636,"props":802,"children":803},{"style":651},[804],{"type":612,"value":755},{"type":606,"tag":636,"props":806,"children":807},{"style":663},[808],{"type":612,"value":760},{"type":606,"tag":636,"props":810,"children":811},{"style":763},[812],{"type":612,"value":813},"\"Age seems unrealistic\"",{"type":606,"tag":636,"props":815,"children":816},{"style":663},[817],{"type":612,"value":771},{"type":606,"tag":636,"props":819,"children":820},{"class":638,"line":108},[821,826],{"type":606,"tag":636,"props":822,"children":823},{"style":651},[824],{"type":612,"value":825},"    return",{"type":606,"tag":636,"props":827,"children":828},{"style":663},[829],{"type":612,"value":830}," age\n",{"type":606,"tag":636,"props":832,"children":833},{"class":638,"line":117},[834],{"type":606,"tag":636,"props":835,"children":836},{"emptyLinePlaceholder":13},[837],{"type":612,"value":693},{"type":606,"tag":636,"props":839,"children":840},{"class":638,"line":126},[841,846],{"type":606,"tag":636,"props":842,"children":843},{"style":651},[844],{"type":612,"value":845},"try",{"type":606,"tag":636,"props":847,"children":848},{"style":663},[849],{"type":612,"value":747},{"type":606,"tag":636,"props":851,"children":852},{"class":638,"line":135},[853,858,863,868,873,878],{"type":606,"tag":636,"props":854,"children":855},{"style":663},[856],{"type":612,"value":857},"    age ",{"type":606,"tag":636,"props":859,"children":860},{"style":651},[861],{"type":612,"value":862},"=",{"type":606,"tag":636,"props":864,"children":865},{"style":663},[866],{"type":612,"value":867}," validate_age(",{"type":606,"tag":636,"props":869,"children":870},{"style":651},[871],{"type":612,"value":872},"-",{"type":606,"tag":636,"props":874,"children":875},{"style":669},[876],{"type":612,"value":877},"5",{"type":606,"tag":636,"props":879,"children":880},{"style":663},[881],{"type":612,"value":771},{"type":606,"tag":636,"props":883,"children":884},{"class":638,"line":144},[885,890,895,900],{"type":606,"tag":636,"props":886,"children":887},{"style":651},[888],{"type":612,"value":889},"except",{"type":606,"tag":636,"props":891,"children":892},{"style":663},[893],{"type":612,"value":894}," ValidationError ",{"type":606,"tag":636,"props":896,"children":897},{"style":651},[898],{"type":612,"value":899},"as",{"type":606,"tag":636,"props":901,"children":902},{"style":663},[903],{"type":612,"value":904}," e:\n",{"type":606,"tag":636,"props":906,"children":907},{"class":638,"line":153},[908,913,917,922,927,932,937,942,947],{"type":606,"tag":636,"props":909,"children":910},{"style":669},[911],{"type":612,"value":912},"    print",{"type":606,"tag":636,"props":914,"children":915},{"style":663},[916],{"type":612,"value":666},{"type":606,"tag":636,"props":918,"children":919},{"style":651},[920],{"type":612,"value":921},"f",{"type":606,"tag":636,"props":923,"children":924},{"style":763},[925],{"type":612,"value":926},"\"Validation failed: ",{"type":606,"tag":636,"props":928,"children":929},{"style":669},[930],{"type":612,"value":931},"{",{"type":606,"tag":636,"props":933,"children":934},{"style":663},[935],{"type":612,"value":936},"e",{"type":606,"tag":636,"props":938,"children":939},{"style":669},[940],{"type":612,"value":941},"}",{"type":606,"tag":636,"props":943,"children":944},{"style":763},[945],{"type":612,"value":946},"\"",{"type":606,"tag":636,"props":948,"children":949},{"style":663},[950],{"type":612,"value":771},{"type":606,"tag":952,"props":953,"children":955},"h2",{"id":954},"basic-custom-exceptions",[956],{"type":612,"value":957},"🎯 Basic Custom Exceptions",{"type":606,"tag":615,"props":959,"children":960},{},[961],{"type":612,"value":962},"Custom exceptions are classes that inherit from the built-in Exception class.",{"type":606,"tag":964,"props":965,"children":969},"info-box",{"emoji":966,"title":967,"type":968},"🏗️","Custom Exception Structure","info",[970,979,1017,1025],{"type":606,"tag":615,"props":971,"children":972},{},[973],{"type":606,"tag":974,"props":975,"children":976},"strong",{},[977],{"type":612,"value":978},"Basic Structure:",{"type":606,"tag":625,"props":980,"children":982},{"className":627,"code":981,"language":629,"meta":8,"style":8},"class CustomError(Exception):\n    pass\n",[983],{"type":606,"tag":632,"props":984,"children":985},{"__ignoreMap":8},[986,1010],{"type":606,"tag":636,"props":987,"children":988},{"class":638,"line":12},[989,993,998,1002,1006],{"type":606,"tag":636,"props":990,"children":991},{"style":651},[992],{"type":612,"value":654},{"type":606,"tag":636,"props":994,"children":995},{"style":657},[996],{"type":612,"value":997}," CustomError",{"type":606,"tag":636,"props":999,"children":1000},{"style":663},[1001],{"type":612,"value":666},{"type":606,"tag":636,"props":1003,"children":1004},{"style":669},[1005],{"type":612,"value":672},{"type":606,"tag":636,"props":1007,"children":1008},{"style":663},[1009],{"type":612,"value":677},{"type":606,"tag":636,"props":1011,"children":1012},{"class":638,"line":27},[1013],{"type":606,"tag":636,"props":1014,"children":1015},{"style":651},[1016],{"type":612,"value":685},{"type":606,"tag":615,"props":1018,"children":1019},{},[1020],{"type":606,"tag":974,"props":1021,"children":1022},{},[1023],{"type":612,"value":1024},"Benefits:",{"type":606,"tag":1026,"props":1027,"children":1028},"ul",{},[1029,1035,1040,1045],{"type":606,"tag":1030,"props":1031,"children":1032},"li",{},[1033],{"type":612,"value":1034},"Specific error types for your application",{"type":606,"tag":1030,"props":1036,"children":1037},{},[1038],{"type":612,"value":1039},"Better error categorization",{"type":606,"tag":1030,"props":1041,"children":1042},{},[1043],{"type":612,"value":1044},"Custom error messages and data",{"type":606,"tag":1030,"props":1046,"children":1047},{},[1048],{"type":612,"value":1049},"Cleaner exception handling",{"type":606,"tag":1051,"props":1052,"children":1054},"h3",{"id":1053},"simple-custom-exception",[1055],{"type":612,"value":1056},"Simple Custom Exception",{"type":606,"tag":621,"props":1058,"children":1059},{},[1060],{"type":606,"tag":625,"props":1061,"children":1063},{"className":627,"code":1062,"language":629,"meta":8,"style":8},"# Define custom exceptions\nclass InvalidEmailError(Exception):\n    pass\n\nclass PasswordTooShortError(Exception):\n    pass\n\n# Use custom exceptions\ndef validate_email(email):\n    if \"@\" not in email:\n        raise InvalidEmailError(\"Email must contain @ symbol\")\n    return email\n\ndef validate_password(password):\n    if len(password) \u003C 8:\n        raise PasswordTooShortError(\"Password must be at least 8 characters\")\n    return password\n\n# Test validation\ntry:\n    email = validate_email(\"invalid-email\")\nexcept InvalidEmailError as e:\n    print(f\"Email error: {e}\")\n\ntry:\n    password = validate_password(\"123\")\nexcept PasswordTooShortError as e:\n    print(f\"Password error: {e}\")\n",[1064],{"type":606,"tag":632,"props":1065,"children":1066},{"__ignoreMap":8},[1067,1075,1099,1106,1113,1137,1144,1151,1159,1176,1203,1224,1236,1243,1260,1290,1311,1323,1330,1338,1349,1375,1395,1435,1442,1453,1479,1499],{"type":606,"tag":636,"props":1068,"children":1069},{"class":638,"line":12},[1070],{"type":606,"tag":636,"props":1071,"children":1072},{"style":642},[1073],{"type":612,"value":1074},"# Define custom exceptions\n",{"type":606,"tag":636,"props":1076,"children":1077},{"class":638,"line":27},[1078,1082,1087,1091,1095],{"type":606,"tag":636,"props":1079,"children":1080},{"style":651},[1081],{"type":612,"value":654},{"type":606,"tag":636,"props":1083,"children":1084},{"style":657},[1085],{"type":612,"value":1086}," InvalidEmailError",{"type":606,"tag":636,"props":1088,"children":1089},{"style":663},[1090],{"type":612,"value":666},{"type":606,"tag":636,"props":1092,"children":1093},{"style":669},[1094],{"type":612,"value":672},{"type":606,"tag":636,"props":1096,"children":1097},{"style":663},[1098],{"type":612,"value":677},{"type":606,"tag":636,"props":1100,"children":1101},{"class":638,"line":36},[1102],{"type":606,"tag":636,"props":1103,"children":1104},{"style":651},[1105],{"type":612,"value":685},{"type":606,"tag":636,"props":1107,"children":1108},{"class":638,"line":45},[1109],{"type":606,"tag":636,"props":1110,"children":1111},{"emptyLinePlaceholder":13},[1112],{"type":612,"value":693},{"type":606,"tag":636,"props":1114,"children":1115},{"class":638,"line":54},[1116,1120,1125,1129,1133],{"type":606,"tag":636,"props":1117,"children":1118},{"style":651},[1119],{"type":612,"value":654},{"type":606,"tag":636,"props":1121,"children":1122},{"style":657},[1123],{"type":612,"value":1124}," PasswordTooShortError",{"type":606,"tag":636,"props":1126,"children":1127},{"style":663},[1128],{"type":612,"value":666},{"type":606,"tag":636,"props":1130,"children":1131},{"style":669},[1132],{"type":612,"value":672},{"type":606,"tag":636,"props":1134,"children":1135},{"style":663},[1136],{"type":612,"value":677},{"type":606,"tag":636,"props":1138,"children":1139},{"class":638,"line":63},[1140],{"type":606,"tag":636,"props":1141,"children":1142},{"style":651},[1143],{"type":612,"value":685},{"type":606,"tag":636,"props":1145,"children":1146},{"class":638,"line":72},[1147],{"type":606,"tag":636,"props":1148,"children":1149},{"emptyLinePlaceholder":13},[1150],{"type":612,"value":693},{"type":606,"tag":636,"props":1152,"children":1153},{"class":638,"line":81},[1154],{"type":606,"tag":636,"props":1155,"children":1156},{"style":642},[1157],{"type":612,"value":1158},"# Use custom exceptions\n",{"type":606,"tag":636,"props":1160,"children":1161},{"class":638,"line":774},[1162,1166,1171],{"type":606,"tag":636,"props":1163,"children":1164},{"style":651},[1165],{"type":612,"value":709},{"type":606,"tag":636,"props":1167,"children":1168},{"style":657},[1169],{"type":612,"value":1170}," validate_email",{"type":606,"tag":636,"props":1172,"children":1173},{"style":663},[1174],{"type":612,"value":1175},"(email):\n",{"type":606,"tag":636,"props":1177,"children":1178},{"class":638,"line":99},[1179,1183,1188,1193,1198],{"type":606,"tag":636,"props":1180,"children":1181},{"style":651},[1182],{"type":612,"value":727},{"type":606,"tag":636,"props":1184,"children":1185},{"style":763},[1186],{"type":612,"value":1187}," \"@\"",{"type":606,"tag":636,"props":1189,"children":1190},{"style":651},[1191],{"type":612,"value":1192}," not",{"type":606,"tag":636,"props":1194,"children":1195},{"style":651},[1196],{"type":612,"value":1197}," in",{"type":606,"tag":636,"props":1199,"children":1200},{"style":663},[1201],{"type":612,"value":1202}," email:\n",{"type":606,"tag":636,"props":1204,"children":1205},{"class":638,"line":108},[1206,1210,1215,1220],{"type":606,"tag":636,"props":1207,"children":1208},{"style":651},[1209],{"type":612,"value":755},{"type":606,"tag":636,"props":1211,"children":1212},{"style":663},[1213],{"type":612,"value":1214}," InvalidEmailError(",{"type":606,"tag":636,"props":1216,"children":1217},{"style":763},[1218],{"type":612,"value":1219},"\"Email must contain @ symbol\"",{"type":606,"tag":636,"props":1221,"children":1222},{"style":663},[1223],{"type":612,"value":771},{"type":606,"tag":636,"props":1225,"children":1226},{"class":638,"line":117},[1227,1231],{"type":606,"tag":636,"props":1228,"children":1229},{"style":651},[1230],{"type":612,"value":825},{"type":606,"tag":636,"props":1232,"children":1233},{"style":663},[1234],{"type":612,"value":1235}," email\n",{"type":606,"tag":636,"props":1237,"children":1238},{"class":638,"line":126},[1239],{"type":606,"tag":636,"props":1240,"children":1241},{"emptyLinePlaceholder":13},[1242],{"type":612,"value":693},{"type":606,"tag":636,"props":1244,"children":1245},{"class":638,"line":135},[1246,1250,1255],{"type":606,"tag":636,"props":1247,"children":1248},{"style":651},[1249],{"type":612,"value":709},{"type":606,"tag":636,"props":1251,"children":1252},{"style":657},[1253],{"type":612,"value":1254}," validate_password",{"type":606,"tag":636,"props":1256,"children":1257},{"style":663},[1258],{"type":612,"value":1259},"(password):\n",{"type":606,"tag":636,"props":1261,"children":1262},{"class":638,"line":144},[1263,1267,1272,1277,1281,1286],{"type":606,"tag":636,"props":1264,"children":1265},{"style":651},[1266],{"type":612,"value":727},{"type":606,"tag":636,"props":1268,"children":1269},{"style":669},[1270],{"type":612,"value":1271}," len",{"type":606,"tag":636,"props":1273,"children":1274},{"style":663},[1275],{"type":612,"value":1276},"(password) ",{"type":606,"tag":636,"props":1278,"children":1279},{"style":651},[1280],{"type":612,"value":737},{"type":606,"tag":636,"props":1282,"children":1283},{"style":669},[1284],{"type":612,"value":1285}," 8",{"type":606,"tag":636,"props":1287,"children":1288},{"style":663},[1289],{"type":612,"value":747},{"type":606,"tag":636,"props":1291,"children":1292},{"class":638,"line":153},[1293,1297,1302,1307],{"type":606,"tag":636,"props":1294,"children":1295},{"style":651},[1296],{"type":612,"value":755},{"type":606,"tag":636,"props":1298,"children":1299},{"style":663},[1300],{"type":612,"value":1301}," PasswordTooShortError(",{"type":606,"tag":636,"props":1303,"children":1304},{"style":763},[1305],{"type":612,"value":1306},"\"Password must be at least 8 characters\"",{"type":606,"tag":636,"props":1308,"children":1309},{"style":663},[1310],{"type":612,"value":771},{"type":606,"tag":636,"props":1312,"children":1313},{"class":638,"line":163},[1314,1318],{"type":606,"tag":636,"props":1315,"children":1316},{"style":651},[1317],{"type":612,"value":825},{"type":606,"tag":636,"props":1319,"children":1320},{"style":663},[1321],{"type":612,"value":1322}," password\n",{"type":606,"tag":636,"props":1324,"children":1325},{"class":638,"line":172},[1326],{"type":606,"tag":636,"props":1327,"children":1328},{"emptyLinePlaceholder":13},[1329],{"type":612,"value":693},{"type":606,"tag":636,"props":1331,"children":1332},{"class":638,"line":181},[1333],{"type":606,"tag":636,"props":1334,"children":1335},{"style":642},[1336],{"type":612,"value":1337},"# Test validation\n",{"type":606,"tag":636,"props":1339,"children":1340},{"class":638,"line":190},[1341,1345],{"type":606,"tag":636,"props":1342,"children":1343},{"style":651},[1344],{"type":612,"value":845},{"type":606,"tag":636,"props":1346,"children":1347},{"style":663},[1348],{"type":612,"value":747},{"type":606,"tag":636,"props":1350,"children":1351},{"class":638,"line":199},[1352,1357,1361,1366,1371],{"type":606,"tag":636,"props":1353,"children":1354},{"style":663},[1355],{"type":612,"value":1356},"    email ",{"type":606,"tag":636,"props":1358,"children":1359},{"style":651},[1360],{"type":612,"value":862},{"type":606,"tag":636,"props":1362,"children":1363},{"style":663},[1364],{"type":612,"value":1365}," validate_email(",{"type":606,"tag":636,"props":1367,"children":1368},{"style":763},[1369],{"type":612,"value":1370},"\"invalid-email\"",{"type":606,"tag":636,"props":1372,"children":1373},{"style":663},[1374],{"type":612,"value":771},{"type":606,"tag":636,"props":1376,"children":1377},{"class":638,"line":208},[1378,1382,1387,1391],{"type":606,"tag":636,"props":1379,"children":1380},{"style":651},[1381],{"type":612,"value":889},{"type":606,"tag":636,"props":1383,"children":1384},{"style":663},[1385],{"type":612,"value":1386}," InvalidEmailError ",{"type":606,"tag":636,"props":1388,"children":1389},{"style":651},[1390],{"type":612,"value":899},{"type":606,"tag":636,"props":1392,"children":1393},{"style":663},[1394],{"type":612,"value":904},{"type":606,"tag":636,"props":1396,"children":1397},{"class":638,"line":217},[1398,1402,1406,1410,1415,1419,1423,1427,1431],{"type":606,"tag":636,"props":1399,"children":1400},{"style":669},[1401],{"type":612,"value":912},{"type":606,"tag":636,"props":1403,"children":1404},{"style":663},[1405],{"type":612,"value":666},{"type":606,"tag":636,"props":1407,"children":1408},{"style":651},[1409],{"type":612,"value":921},{"type":606,"tag":636,"props":1411,"children":1412},{"style":763},[1413],{"type":612,"value":1414},"\"Email error: ",{"type":606,"tag":636,"props":1416,"children":1417},{"style":669},[1418],{"type":612,"value":931},{"type":606,"tag":636,"props":1420,"children":1421},{"style":663},[1422],{"type":612,"value":936},{"type":606,"tag":636,"props":1424,"children":1425},{"style":669},[1426],{"type":612,"value":941},{"type":606,"tag":636,"props":1428,"children":1429},{"style":763},[1430],{"type":612,"value":946},{"type":606,"tag":636,"props":1432,"children":1433},{"style":663},[1434],{"type":612,"value":771},{"type":606,"tag":636,"props":1436,"children":1437},{"class":638,"line":227},[1438],{"type":606,"tag":636,"props":1439,"children":1440},{"emptyLinePlaceholder":13},[1441],{"type":612,"value":693},{"type":606,"tag":636,"props":1443,"children":1444},{"class":638,"line":236},[1445,1449],{"type":606,"tag":636,"props":1446,"children":1447},{"style":651},[1448],{"type":612,"value":845},{"type":606,"tag":636,"props":1450,"children":1451},{"style":663},[1452],{"type":612,"value":747},{"type":606,"tag":636,"props":1454,"children":1455},{"class":638,"line":245},[1456,1461,1465,1470,1475],{"type":606,"tag":636,"props":1457,"children":1458},{"style":663},[1459],{"type":612,"value":1460},"    password ",{"type":606,"tag":636,"props":1462,"children":1463},{"style":651},[1464],{"type":612,"value":862},{"type":606,"tag":636,"props":1466,"children":1467},{"style":663},[1468],{"type":612,"value":1469}," validate_password(",{"type":606,"tag":636,"props":1471,"children":1472},{"style":763},[1473],{"type":612,"value":1474},"\"123\"",{"type":606,"tag":636,"props":1476,"children":1477},{"style":663},[1478],{"type":612,"value":771},{"type":606,"tag":636,"props":1480,"children":1481},{"class":638,"line":254},[1482,1486,1491,1495],{"type":606,"tag":636,"props":1483,"children":1484},{"style":651},[1485],{"type":612,"value":889},{"type":606,"tag":636,"props":1487,"children":1488},{"style":663},[1489],{"type":612,"value":1490}," PasswordTooShortError ",{"type":606,"tag":636,"props":1492,"children":1493},{"style":651},[1494],{"type":612,"value":899},{"type":606,"tag":636,"props":1496,"children":1497},{"style":663},[1498],{"type":612,"value":904},{"type":606,"tag":636,"props":1500,"children":1501},{"class":638,"line":263},[1502,1506,1510,1514,1519,1523,1527,1531,1535],{"type":606,"tag":636,"props":1503,"children":1504},{"style":669},[1505],{"type":612,"value":912},{"type":606,"tag":636,"props":1507,"children":1508},{"style":663},[1509],{"type":612,"value":666},{"type":606,"tag":636,"props":1511,"children":1512},{"style":651},[1513],{"type":612,"value":921},{"type":606,"tag":636,"props":1515,"children":1516},{"style":763},[1517],{"type":612,"value":1518},"\"Password error: ",{"type":606,"tag":636,"props":1520,"children":1521},{"style":669},[1522],{"type":612,"value":931},{"type":606,"tag":636,"props":1524,"children":1525},{"style":663},[1526],{"type":612,"value":936},{"type":606,"tag":636,"props":1528,"children":1529},{"style":669},[1530],{"type":612,"value":941},{"type":606,"tag":636,"props":1532,"children":1533},{"style":763},[1534],{"type":612,"value":946},{"type":606,"tag":636,"props":1536,"children":1537},{"style":663},[1538],{"type":612,"value":771},{"type":606,"tag":1051,"props":1540,"children":1542},{"id":1541},"custom-exception-with-additional-data",[1543],{"type":612,"value":1544},"Custom Exception with Additional Data",{"type":606,"tag":621,"props":1546,"children":1547},{},[1548],{"type":606,"tag":625,"props":1549,"children":1551},{"className":627,"code":1550,"language":629,"meta":8,"style":8},"# Exception with extra information\nclass OutOfStockError(Exception):\n    def __init__(self, product, available):\n        self.product = product\n        self.available = available\n        message = f\"Product '{product}' out of stock. Available: {available}\"\n        super().__init__(message)\n\n# Use exception with data\ndef purchase_item(product, quantity):\n    stock = {\"apples\": 5, \"bananas\": 0, \"oranges\": 3}\n    available = stock.get(product, 0)\n    \n    if available \u003C quantity:\n        raise OutOfStockError(product, available)\n    \n    return f\"Purchased {quantity} {product}\"\n\ntry:\n    result = purchase_item(\"bananas\", 2)\nexcept OutOfStockError as e:\n    print(f\"Error: {e}\")\n    print(f\"Product: {e.product}\")\n    print(f\"Available: {e.available}\")\n",[1552],{"type":606,"tag":632,"props":1553,"children":1554},{"__ignoreMap":8},[1555,1563,1587,1605,1627,1648,1706,1729,1736,1744,1761,1834,1859,1867,1888,1900,1907,1952,1959,1970,2004,2024,2064,2105],{"type":606,"tag":636,"props":1556,"children":1557},{"class":638,"line":12},[1558],{"type":606,"tag":636,"props":1559,"children":1560},{"style":642},[1561],{"type":612,"value":1562},"# Exception with extra information\n",{"type":606,"tag":636,"props":1564,"children":1565},{"class":638,"line":27},[1566,1570,1575,1579,1583],{"type":606,"tag":636,"props":1567,"children":1568},{"style":651},[1569],{"type":612,"value":654},{"type":606,"tag":636,"props":1571,"children":1572},{"style":657},[1573],{"type":612,"value":1574}," OutOfStockError",{"type":606,"tag":636,"props":1576,"children":1577},{"style":663},[1578],{"type":612,"value":666},{"type":606,"tag":636,"props":1580,"children":1581},{"style":669},[1582],{"type":612,"value":672},{"type":606,"tag":636,"props":1584,"children":1585},{"style":663},[1586],{"type":612,"value":677},{"type":606,"tag":636,"props":1588,"children":1589},{"class":638,"line":36},[1590,1595,1600],{"type":606,"tag":636,"props":1591,"children":1592},{"style":651},[1593],{"type":612,"value":1594},"    def",{"type":606,"tag":636,"props":1596,"children":1597},{"style":669},[1598],{"type":612,"value":1599}," __init__",{"type":606,"tag":636,"props":1601,"children":1602},{"style":663},[1603],{"type":612,"value":1604},"(self, product, available):\n",{"type":606,"tag":636,"props":1606,"children":1607},{"class":638,"line":45},[1608,1613,1618,1622],{"type":606,"tag":636,"props":1609,"children":1610},{"style":669},[1611],{"type":612,"value":1612},"        self",{"type":606,"tag":636,"props":1614,"children":1615},{"style":663},[1616],{"type":612,"value":1617},".product ",{"type":606,"tag":636,"props":1619,"children":1620},{"style":651},[1621],{"type":612,"value":862},{"type":606,"tag":636,"props":1623,"children":1624},{"style":663},[1625],{"type":612,"value":1626}," product\n",{"type":606,"tag":636,"props":1628,"children":1629},{"class":638,"line":54},[1630,1634,1639,1643],{"type":606,"tag":636,"props":1631,"children":1632},{"style":669},[1633],{"type":612,"value":1612},{"type":606,"tag":636,"props":1635,"children":1636},{"style":663},[1637],{"type":612,"value":1638},".available ",{"type":606,"tag":636,"props":1640,"children":1641},{"style":651},[1642],{"type":612,"value":862},{"type":606,"tag":636,"props":1644,"children":1645},{"style":663},[1646],{"type":612,"value":1647}," available\n",{"type":606,"tag":636,"props":1649,"children":1650},{"class":638,"line":63},[1651,1656,1660,1665,1670,1674,1679,1683,1688,1692,1697,1701],{"type":606,"tag":636,"props":1652,"children":1653},{"style":663},[1654],{"type":612,"value":1655},"        message ",{"type":606,"tag":636,"props":1657,"children":1658},{"style":651},[1659],{"type":612,"value":862},{"type":606,"tag":636,"props":1661,"children":1662},{"style":651},[1663],{"type":612,"value":1664}," f",{"type":606,"tag":636,"props":1666,"children":1667},{"style":763},[1668],{"type":612,"value":1669},"\"Product '",{"type":606,"tag":636,"props":1671,"children":1672},{"style":669},[1673],{"type":612,"value":931},{"type":606,"tag":636,"props":1675,"children":1676},{"style":663},[1677],{"type":612,"value":1678},"product",{"type":606,"tag":636,"props":1680,"children":1681},{"style":669},[1682],{"type":612,"value":941},{"type":606,"tag":636,"props":1684,"children":1685},{"style":763},[1686],{"type":612,"value":1687},"' out of stock. Available: ",{"type":606,"tag":636,"props":1689,"children":1690},{"style":669},[1691],{"type":612,"value":931},{"type":606,"tag":636,"props":1693,"children":1694},{"style":663},[1695],{"type":612,"value":1696},"available",{"type":606,"tag":636,"props":1698,"children":1699},{"style":669},[1700],{"type":612,"value":941},{"type":606,"tag":636,"props":1702,"children":1703},{"style":763},[1704],{"type":612,"value":1705},"\"\n",{"type":606,"tag":636,"props":1707,"children":1708},{"class":638,"line":72},[1709,1714,1719,1724],{"type":606,"tag":636,"props":1710,"children":1711},{"style":669},[1712],{"type":612,"value":1713},"        super",{"type":606,"tag":636,"props":1715,"children":1716},{"style":663},[1717],{"type":612,"value":1718},"().",{"type":606,"tag":636,"props":1720,"children":1721},{"style":669},[1722],{"type":612,"value":1723},"__init__",{"type":606,"tag":636,"props":1725,"children":1726},{"style":663},[1727],{"type":612,"value":1728},"(message)\n",{"type":606,"tag":636,"props":1730,"children":1731},{"class":638,"line":81},[1732],{"type":606,"tag":636,"props":1733,"children":1734},{"emptyLinePlaceholder":13},[1735],{"type":612,"value":693},{"type":606,"tag":636,"props":1737,"children":1738},{"class":638,"line":774},[1739],{"type":606,"tag":636,"props":1740,"children":1741},{"style":642},[1742],{"type":612,"value":1743},"# Use exception with data\n",{"type":606,"tag":636,"props":1745,"children":1746},{"class":638,"line":99},[1747,1751,1756],{"type":606,"tag":636,"props":1748,"children":1749},{"style":651},[1750],{"type":612,"value":709},{"type":606,"tag":636,"props":1752,"children":1753},{"style":657},[1754],{"type":612,"value":1755}," purchase_item",{"type":606,"tag":636,"props":1757,"children":1758},{"style":663},[1759],{"type":612,"value":1760},"(product, quantity):\n",{"type":606,"tag":636,"props":1762,"children":1763},{"class":638,"line":108},[1764,1769,1773,1778,1783,1788,1792,1797,1802,1806,1811,1815,1820,1824,1829],{"type":606,"tag":636,"props":1765,"children":1766},{"style":663},[1767],{"type":612,"value":1768},"    stock ",{"type":606,"tag":636,"props":1770,"children":1771},{"style":651},[1772],{"type":612,"value":862},{"type":606,"tag":636,"props":1774,"children":1775},{"style":663},[1776],{"type":612,"value":1777}," {",{"type":606,"tag":636,"props":1779,"children":1780},{"style":763},[1781],{"type":612,"value":1782},"\"apples\"",{"type":606,"tag":636,"props":1784,"children":1785},{"style":663},[1786],{"type":612,"value":1787},": ",{"type":606,"tag":636,"props":1789,"children":1790},{"style":669},[1791],{"type":612,"value":877},{"type":606,"tag":636,"props":1793,"children":1794},{"style":663},[1795],{"type":612,"value":1796},", ",{"type":606,"tag":636,"props":1798,"children":1799},{"style":763},[1800],{"type":612,"value":1801},"\"bananas\"",{"type":606,"tag":636,"props":1803,"children":1804},{"style":663},[1805],{"type":612,"value":1787},{"type":606,"tag":636,"props":1807,"children":1808},{"style":669},[1809],{"type":612,"value":1810},"0",{"type":606,"tag":636,"props":1812,"children":1813},{"style":663},[1814],{"type":612,"value":1796},{"type":606,"tag":636,"props":1816,"children":1817},{"style":763},[1818],{"type":612,"value":1819},"\"oranges\"",{"type":606,"tag":636,"props":1821,"children":1822},{"style":663},[1823],{"type":612,"value":1787},{"type":606,"tag":636,"props":1825,"children":1826},{"style":669},[1827],{"type":612,"value":1828},"3",{"type":606,"tag":636,"props":1830,"children":1831},{"style":663},[1832],{"type":612,"value":1833},"}\n",{"type":606,"tag":636,"props":1835,"children":1836},{"class":638,"line":117},[1837,1842,1846,1851,1855],{"type":606,"tag":636,"props":1838,"children":1839},{"style":663},[1840],{"type":612,"value":1841},"    available ",{"type":606,"tag":636,"props":1843,"children":1844},{"style":651},[1845],{"type":612,"value":862},{"type":606,"tag":636,"props":1847,"children":1848},{"style":663},[1849],{"type":612,"value":1850}," stock.get(product, ",{"type":606,"tag":636,"props":1852,"children":1853},{"style":669},[1854],{"type":612,"value":1810},{"type":606,"tag":636,"props":1856,"children":1857},{"style":663},[1858],{"type":612,"value":771},{"type":606,"tag":636,"props":1860,"children":1861},{"class":638,"line":126},[1862],{"type":606,"tag":636,"props":1863,"children":1864},{"style":663},[1865],{"type":612,"value":1866},"    \n",{"type":606,"tag":636,"props":1868,"children":1869},{"class":638,"line":135},[1870,1874,1879,1883],{"type":606,"tag":636,"props":1871,"children":1872},{"style":651},[1873],{"type":612,"value":727},{"type":606,"tag":636,"props":1875,"children":1876},{"style":663},[1877],{"type":612,"value":1878}," available ",{"type":606,"tag":636,"props":1880,"children":1881},{"style":651},[1882],{"type":612,"value":737},{"type":606,"tag":636,"props":1884,"children":1885},{"style":663},[1886],{"type":612,"value":1887}," quantity:\n",{"type":606,"tag":636,"props":1889,"children":1890},{"class":638,"line":144},[1891,1895],{"type":606,"tag":636,"props":1892,"children":1893},{"style":651},[1894],{"type":612,"value":755},{"type":606,"tag":636,"props":1896,"children":1897},{"style":663},[1898],{"type":612,"value":1899}," OutOfStockError(product, available)\n",{"type":606,"tag":636,"props":1901,"children":1902},{"class":638,"line":153},[1903],{"type":606,"tag":636,"props":1904,"children":1905},{"style":663},[1906],{"type":612,"value":1866},{"type":606,"tag":636,"props":1908,"children":1909},{"class":638,"line":163},[1910,1914,1918,1923,1927,1932,1936,1940,1944,1948],{"type":606,"tag":636,"props":1911,"children":1912},{"style":651},[1913],{"type":612,"value":825},{"type":606,"tag":636,"props":1915,"children":1916},{"style":651},[1917],{"type":612,"value":1664},{"type":606,"tag":636,"props":1919,"children":1920},{"style":763},[1921],{"type":612,"value":1922},"\"Purchased ",{"type":606,"tag":636,"props":1924,"children":1925},{"style":669},[1926],{"type":612,"value":931},{"type":606,"tag":636,"props":1928,"children":1929},{"style":663},[1930],{"type":612,"value":1931},"quantity",{"type":606,"tag":636,"props":1933,"children":1934},{"style":669},[1935],{"type":612,"value":941},{"type":606,"tag":636,"props":1937,"children":1938},{"style":669},[1939],{"type":612,"value":1777},{"type":606,"tag":636,"props":1941,"children":1942},{"style":663},[1943],{"type":612,"value":1678},{"type":606,"tag":636,"props":1945,"children":1946},{"style":669},[1947],{"type":612,"value":941},{"type":606,"tag":636,"props":1949,"children":1950},{"style":763},[1951],{"type":612,"value":1705},{"type":606,"tag":636,"props":1953,"children":1954},{"class":638,"line":172},[1955],{"type":606,"tag":636,"props":1956,"children":1957},{"emptyLinePlaceholder":13},[1958],{"type":612,"value":693},{"type":606,"tag":636,"props":1960,"children":1961},{"class":638,"line":181},[1962,1966],{"type":606,"tag":636,"props":1963,"children":1964},{"style":651},[1965],{"type":612,"value":845},{"type":606,"tag":636,"props":1967,"children":1968},{"style":663},[1969],{"type":612,"value":747},{"type":606,"tag":636,"props":1971,"children":1972},{"class":638,"line":190},[1973,1978,1982,1987,1991,1995,2000],{"type":606,"tag":636,"props":1974,"children":1975},{"style":663},[1976],{"type":612,"value":1977},"    result ",{"type":606,"tag":636,"props":1979,"children":1980},{"style":651},[1981],{"type":612,"value":862},{"type":606,"tag":636,"props":1983,"children":1984},{"style":663},[1985],{"type":612,"value":1986}," purchase_item(",{"type":606,"tag":636,"props":1988,"children":1989},{"style":763},[1990],{"type":612,"value":1801},{"type":606,"tag":636,"props":1992,"children":1993},{"style":663},[1994],{"type":612,"value":1796},{"type":606,"tag":636,"props":1996,"children":1997},{"style":669},[1998],{"type":612,"value":1999},"2",{"type":606,"tag":636,"props":2001,"children":2002},{"style":663},[2003],{"type":612,"value":771},{"type":606,"tag":636,"props":2005,"children":2006},{"class":638,"line":199},[2007,2011,2016,2020],{"type":606,"tag":636,"props":2008,"children":2009},{"style":651},[2010],{"type":612,"value":889},{"type":606,"tag":636,"props":2012,"children":2013},{"style":663},[2014],{"type":612,"value":2015}," OutOfStockError ",{"type":606,"tag":636,"props":2017,"children":2018},{"style":651},[2019],{"type":612,"value":899},{"type":606,"tag":636,"props":2021,"children":2022},{"style":663},[2023],{"type":612,"value":904},{"type":606,"tag":636,"props":2025,"children":2026},{"class":638,"line":208},[2027,2031,2035,2039,2044,2048,2052,2056,2060],{"type":606,"tag":636,"props":2028,"children":2029},{"style":669},[2030],{"type":612,"value":912},{"type":606,"tag":636,"props":2032,"children":2033},{"style":663},[2034],{"type":612,"value":666},{"type":606,"tag":636,"props":2036,"children":2037},{"style":651},[2038],{"type":612,"value":921},{"type":606,"tag":636,"props":2040,"children":2041},{"style":763},[2042],{"type":612,"value":2043},"\"Error: ",{"type":606,"tag":636,"props":2045,"children":2046},{"style":669},[2047],{"type":612,"value":931},{"type":606,"tag":636,"props":2049,"children":2050},{"style":663},[2051],{"type":612,"value":936},{"type":606,"tag":636,"props":2053,"children":2054},{"style":669},[2055],{"type":612,"value":941},{"type":606,"tag":636,"props":2057,"children":2058},{"style":763},[2059],{"type":612,"value":946},{"type":606,"tag":636,"props":2061,"children":2062},{"style":663},[2063],{"type":612,"value":771},{"type":606,"tag":636,"props":2065,"children":2066},{"class":638,"line":217},[2067,2071,2075,2079,2084,2088,2093,2097,2101],{"type":606,"tag":636,"props":2068,"children":2069},{"style":669},[2070],{"type":612,"value":912},{"type":606,"tag":636,"props":2072,"children":2073},{"style":663},[2074],{"type":612,"value":666},{"type":606,"tag":636,"props":2076,"children":2077},{"style":651},[2078],{"type":612,"value":921},{"type":606,"tag":636,"props":2080,"children":2081},{"style":763},[2082],{"type":612,"value":2083},"\"Product: ",{"type":606,"tag":636,"props":2085,"children":2086},{"style":669},[2087],{"type":612,"value":931},{"type":606,"tag":636,"props":2089,"children":2090},{"style":663},[2091],{"type":612,"value":2092},"e.product",{"type":606,"tag":636,"props":2094,"children":2095},{"style":669},[2096],{"type":612,"value":941},{"type":606,"tag":636,"props":2098,"children":2099},{"style":763},[2100],{"type":612,"value":946},{"type":606,"tag":636,"props":2102,"children":2103},{"style":663},[2104],{"type":612,"value":771},{"type":606,"tag":636,"props":2106,"children":2107},{"class":638,"line":227},[2108,2112,2116,2120,2125,2129,2134,2138,2142],{"type":606,"tag":636,"props":2109,"children":2110},{"style":669},[2111],{"type":612,"value":912},{"type":606,"tag":636,"props":2113,"children":2114},{"style":663},[2115],{"type":612,"value":666},{"type":606,"tag":636,"props":2117,"children":2118},{"style":651},[2119],{"type":612,"value":921},{"type":606,"tag":636,"props":2121,"children":2122},{"style":763},[2123],{"type":612,"value":2124},"\"Available: ",{"type":606,"tag":636,"props":2126,"children":2127},{"style":669},[2128],{"type":612,"value":931},{"type":606,"tag":636,"props":2130,"children":2131},{"style":663},[2132],{"type":612,"value":2133},"e.available",{"type":606,"tag":636,"props":2135,"children":2136},{"style":669},[2137],{"type":612,"value":941},{"type":606,"tag":636,"props":2139,"children":2140},{"style":763},[2141],{"type":612,"value":946},{"type":606,"tag":636,"props":2143,"children":2144},{"style":663},[2145],{"type":612,"value":771},{"type":606,"tag":1051,"props":2147,"children":2149},{"id":2148},"exception-hierarchy",[2150],{"type":612,"value":2151},"Exception Hierarchy",{"type":606,"tag":621,"props":2153,"children":2154},{},[2155],{"type":606,"tag":625,"props":2156,"children":2158},{"className":627,"code":2157,"language":629,"meta":8,"style":8},"# Base custom exception\nclass APIError(Exception):\n    pass\n\n# Specific API exceptions\nclass AuthenticationError(APIError):\n    pass\n\nclass RateLimitError(APIError):\n    pass\n\nclass ServerError(APIError):\n    pass\n\n# Function that raises different errors\ndef api_call(status_code):\n    if status_code == 401:\n        raise AuthenticationError(\"Invalid credentials\")\n    elif status_code == 429:\n        raise RateLimitError(\"Too many requests\")\n    elif status_code >= 500:\n        raise ServerError(\"Server error occurred\")\n    return \"API call successful\"\n\n# Handle different error types\ntry:\n    result = api_call(429)\nexcept AuthenticationError:\n    print(\"Please check your credentials\")\nexcept RateLimitError:\n    print(\"Please wait before making more requests\")\nexcept APIError:\n    print(\"General API error occurred\")\n",[2159],{"type":606,"tag":632,"props":2160,"children":2161},{"__ignoreMap":8},[2162,2170,2194,2201,2208,2216,2241,2248,2255,2279,2286,2293,2317,2324,2331,2339,2356,2382,2403,2428,2449,2474,2495,2507,2514,2522,2533,2558,2570,2590,2602,2622,2634],{"type":606,"tag":636,"props":2163,"children":2164},{"class":638,"line":12},[2165],{"type":606,"tag":636,"props":2166,"children":2167},{"style":642},[2168],{"type":612,"value":2169},"# Base custom exception\n",{"type":606,"tag":636,"props":2171,"children":2172},{"class":638,"line":27},[2173,2177,2182,2186,2190],{"type":606,"tag":636,"props":2174,"children":2175},{"style":651},[2176],{"type":612,"value":654},{"type":606,"tag":636,"props":2178,"children":2179},{"style":657},[2180],{"type":612,"value":2181}," APIError",{"type":606,"tag":636,"props":2183,"children":2184},{"style":663},[2185],{"type":612,"value":666},{"type":606,"tag":636,"props":2187,"children":2188},{"style":669},[2189],{"type":612,"value":672},{"type":606,"tag":636,"props":2191,"children":2192},{"style":663},[2193],{"type":612,"value":677},{"type":606,"tag":636,"props":2195,"children":2196},{"class":638,"line":36},[2197],{"type":606,"tag":636,"props":2198,"children":2199},{"style":651},[2200],{"type":612,"value":685},{"type":606,"tag":636,"props":2202,"children":2203},{"class":638,"line":45},[2204],{"type":606,"tag":636,"props":2205,"children":2206},{"emptyLinePlaceholder":13},[2207],{"type":612,"value":693},{"type":606,"tag":636,"props":2209,"children":2210},{"class":638,"line":54},[2211],{"type":606,"tag":636,"props":2212,"children":2213},{"style":642},[2214],{"type":612,"value":2215},"# Specific API exceptions\n",{"type":606,"tag":636,"props":2217,"children":2218},{"class":638,"line":63},[2219,2223,2228,2232,2237],{"type":606,"tag":636,"props":2220,"children":2221},{"style":651},[2222],{"type":612,"value":654},{"type":606,"tag":636,"props":2224,"children":2225},{"style":657},[2226],{"type":612,"value":2227}," AuthenticationError",{"type":606,"tag":636,"props":2229,"children":2230},{"style":663},[2231],{"type":612,"value":666},{"type":606,"tag":636,"props":2233,"children":2234},{"style":657},[2235],{"type":612,"value":2236},"APIError",{"type":606,"tag":636,"props":2238,"children":2239},{"style":663},[2240],{"type":612,"value":677},{"type":606,"tag":636,"props":2242,"children":2243},{"class":638,"line":72},[2244],{"type":606,"tag":636,"props":2245,"children":2246},{"style":651},[2247],{"type":612,"value":685},{"type":606,"tag":636,"props":2249,"children":2250},{"class":638,"line":81},[2251],{"type":606,"tag":636,"props":2252,"children":2253},{"emptyLinePlaceholder":13},[2254],{"type":612,"value":693},{"type":606,"tag":636,"props":2256,"children":2257},{"class":638,"line":774},[2258,2262,2267,2271,2275],{"type":606,"tag":636,"props":2259,"children":2260},{"style":651},[2261],{"type":612,"value":654},{"type":606,"tag":636,"props":2263,"children":2264},{"style":657},[2265],{"type":612,"value":2266}," RateLimitError",{"type":606,"tag":636,"props":2268,"children":2269},{"style":663},[2270],{"type":612,"value":666},{"type":606,"tag":636,"props":2272,"children":2273},{"style":657},[2274],{"type":612,"value":2236},{"type":606,"tag":636,"props":2276,"children":2277},{"style":663},[2278],{"type":612,"value":677},{"type":606,"tag":636,"props":2280,"children":2281},{"class":638,"line":99},[2282],{"type":606,"tag":636,"props":2283,"children":2284},{"style":651},[2285],{"type":612,"value":685},{"type":606,"tag":636,"props":2287,"children":2288},{"class":638,"line":108},[2289],{"type":606,"tag":636,"props":2290,"children":2291},{"emptyLinePlaceholder":13},[2292],{"type":612,"value":693},{"type":606,"tag":636,"props":2294,"children":2295},{"class":638,"line":117},[2296,2300,2305,2309,2313],{"type":606,"tag":636,"props":2297,"children":2298},{"style":651},[2299],{"type":612,"value":654},{"type":606,"tag":636,"props":2301,"children":2302},{"style":657},[2303],{"type":612,"value":2304}," ServerError",{"type":606,"tag":636,"props":2306,"children":2307},{"style":663},[2308],{"type":612,"value":666},{"type":606,"tag":636,"props":2310,"children":2311},{"style":657},[2312],{"type":612,"value":2236},{"type":606,"tag":636,"props":2314,"children":2315},{"style":663},[2316],{"type":612,"value":677},{"type":606,"tag":636,"props":2318,"children":2319},{"class":638,"line":126},[2320],{"type":606,"tag":636,"props":2321,"children":2322},{"style":651},[2323],{"type":612,"value":685},{"type":606,"tag":636,"props":2325,"children":2326},{"class":638,"line":135},[2327],{"type":606,"tag":636,"props":2328,"children":2329},{"emptyLinePlaceholder":13},[2330],{"type":612,"value":693},{"type":606,"tag":636,"props":2332,"children":2333},{"class":638,"line":144},[2334],{"type":606,"tag":636,"props":2335,"children":2336},{"style":642},[2337],{"type":612,"value":2338},"# Function that raises different errors\n",{"type":606,"tag":636,"props":2340,"children":2341},{"class":638,"line":153},[2342,2346,2351],{"type":606,"tag":636,"props":2343,"children":2344},{"style":651},[2345],{"type":612,"value":709},{"type":606,"tag":636,"props":2347,"children":2348},{"style":657},[2349],{"type":612,"value":2350}," api_call",{"type":606,"tag":636,"props":2352,"children":2353},{"style":663},[2354],{"type":612,"value":2355},"(status_code):\n",{"type":606,"tag":636,"props":2357,"children":2358},{"class":638,"line":163},[2359,2363,2368,2373,2378],{"type":606,"tag":636,"props":2360,"children":2361},{"style":651},[2362],{"type":612,"value":727},{"type":606,"tag":636,"props":2364,"children":2365},{"style":663},[2366],{"type":612,"value":2367}," status_code ",{"type":606,"tag":636,"props":2369,"children":2370},{"style":651},[2371],{"type":612,"value":2372},"==",{"type":606,"tag":636,"props":2374,"children":2375},{"style":669},[2376],{"type":612,"value":2377}," 401",{"type":606,"tag":636,"props":2379,"children":2380},{"style":663},[2381],{"type":612,"value":747},{"type":606,"tag":636,"props":2383,"children":2384},{"class":638,"line":172},[2385,2389,2394,2399],{"type":606,"tag":636,"props":2386,"children":2387},{"style":651},[2388],{"type":612,"value":755},{"type":606,"tag":636,"props":2390,"children":2391},{"style":663},[2392],{"type":612,"value":2393}," AuthenticationError(",{"type":606,"tag":636,"props":2395,"children":2396},{"style":763},[2397],{"type":612,"value":2398},"\"Invalid credentials\"",{"type":606,"tag":636,"props":2400,"children":2401},{"style":663},[2402],{"type":612,"value":771},{"type":606,"tag":636,"props":2404,"children":2405},{"class":638,"line":181},[2406,2411,2415,2419,2424],{"type":606,"tag":636,"props":2407,"children":2408},{"style":651},[2409],{"type":612,"value":2410},"    elif",{"type":606,"tag":636,"props":2412,"children":2413},{"style":663},[2414],{"type":612,"value":2367},{"type":606,"tag":636,"props":2416,"children":2417},{"style":651},[2418],{"type":612,"value":2372},{"type":606,"tag":636,"props":2420,"children":2421},{"style":669},[2422],{"type":612,"value":2423}," 429",{"type":606,"tag":636,"props":2425,"children":2426},{"style":663},[2427],{"type":612,"value":747},{"type":606,"tag":636,"props":2429,"children":2430},{"class":638,"line":190},[2431,2435,2440,2445],{"type":606,"tag":636,"props":2432,"children":2433},{"style":651},[2434],{"type":612,"value":755},{"type":606,"tag":636,"props":2436,"children":2437},{"style":663},[2438],{"type":612,"value":2439}," RateLimitError(",{"type":606,"tag":636,"props":2441,"children":2442},{"style":763},[2443],{"type":612,"value":2444},"\"Too many requests\"",{"type":606,"tag":636,"props":2446,"children":2447},{"style":663},[2448],{"type":612,"value":771},{"type":606,"tag":636,"props":2450,"children":2451},{"class":638,"line":199},[2452,2456,2460,2465,2470],{"type":606,"tag":636,"props":2453,"children":2454},{"style":651},[2455],{"type":612,"value":2410},{"type":606,"tag":636,"props":2457,"children":2458},{"style":663},[2459],{"type":612,"value":2367},{"type":606,"tag":636,"props":2461,"children":2462},{"style":651},[2463],{"type":612,"value":2464},">=",{"type":606,"tag":636,"props":2466,"children":2467},{"style":669},[2468],{"type":612,"value":2469}," 500",{"type":606,"tag":636,"props":2471,"children":2472},{"style":663},[2473],{"type":612,"value":747},{"type":606,"tag":636,"props":2475,"children":2476},{"class":638,"line":208},[2477,2481,2486,2491],{"type":606,"tag":636,"props":2478,"children":2479},{"style":651},[2480],{"type":612,"value":755},{"type":606,"tag":636,"props":2482,"children":2483},{"style":663},[2484],{"type":612,"value":2485}," ServerError(",{"type":606,"tag":636,"props":2487,"children":2488},{"style":763},[2489],{"type":612,"value":2490},"\"Server error occurred\"",{"type":606,"tag":636,"props":2492,"children":2493},{"style":663},[2494],{"type":612,"value":771},{"type":606,"tag":636,"props":2496,"children":2497},{"class":638,"line":217},[2498,2502],{"type":606,"tag":636,"props":2499,"children":2500},{"style":651},[2501],{"type":612,"value":825},{"type":606,"tag":636,"props":2503,"children":2504},{"style":763},[2505],{"type":612,"value":2506}," \"API call successful\"\n",{"type":606,"tag":636,"props":2508,"children":2509},{"class":638,"line":227},[2510],{"type":606,"tag":636,"props":2511,"children":2512},{"emptyLinePlaceholder":13},[2513],{"type":612,"value":693},{"type":606,"tag":636,"props":2515,"children":2516},{"class":638,"line":236},[2517],{"type":606,"tag":636,"props":2518,"children":2519},{"style":642},[2520],{"type":612,"value":2521},"# Handle different error types\n",{"type":606,"tag":636,"props":2523,"children":2524},{"class":638,"line":245},[2525,2529],{"type":606,"tag":636,"props":2526,"children":2527},{"style":651},[2528],{"type":612,"value":845},{"type":606,"tag":636,"props":2530,"children":2531},{"style":663},[2532],{"type":612,"value":747},{"type":606,"tag":636,"props":2534,"children":2535},{"class":638,"line":254},[2536,2540,2544,2549,2554],{"type":606,"tag":636,"props":2537,"children":2538},{"style":663},[2539],{"type":612,"value":1977},{"type":606,"tag":636,"props":2541,"children":2542},{"style":651},[2543],{"type":612,"value":862},{"type":606,"tag":636,"props":2545,"children":2546},{"style":663},[2547],{"type":612,"value":2548}," api_call(",{"type":606,"tag":636,"props":2550,"children":2551},{"style":669},[2552],{"type":612,"value":2553},"429",{"type":606,"tag":636,"props":2555,"children":2556},{"style":663},[2557],{"type":612,"value":771},{"type":606,"tag":636,"props":2559,"children":2560},{"class":638,"line":263},[2561,2565],{"type":606,"tag":636,"props":2562,"children":2563},{"style":651},[2564],{"type":612,"value":889},{"type":606,"tag":636,"props":2566,"children":2567},{"style":663},[2568],{"type":612,"value":2569}," AuthenticationError:\n",{"type":606,"tag":636,"props":2571,"children":2572},{"class":638,"line":272},[2573,2577,2581,2586],{"type":606,"tag":636,"props":2574,"children":2575},{"style":669},[2576],{"type":612,"value":912},{"type":606,"tag":636,"props":2578,"children":2579},{"style":663},[2580],{"type":612,"value":666},{"type":606,"tag":636,"props":2582,"children":2583},{"style":763},[2584],{"type":612,"value":2585},"\"Please check your credentials\"",{"type":606,"tag":636,"props":2587,"children":2588},{"style":663},[2589],{"type":612,"value":771},{"type":606,"tag":636,"props":2591,"children":2592},{"class":638,"line":281},[2593,2597],{"type":606,"tag":636,"props":2594,"children":2595},{"style":651},[2596],{"type":612,"value":889},{"type":606,"tag":636,"props":2598,"children":2599},{"style":663},[2600],{"type":612,"value":2601}," RateLimitError:\n",{"type":606,"tag":636,"props":2603,"children":2604},{"class":638,"line":291},[2605,2609,2613,2618],{"type":606,"tag":636,"props":2606,"children":2607},{"style":669},[2608],{"type":612,"value":912},{"type":606,"tag":636,"props":2610,"children":2611},{"style":663},[2612],{"type":612,"value":666},{"type":606,"tag":636,"props":2614,"children":2615},{"style":763},[2616],{"type":612,"value":2617},"\"Please wait before making more requests\"",{"type":606,"tag":636,"props":2619,"children":2620},{"style":663},[2621],{"type":612,"value":771},{"type":606,"tag":636,"props":2623,"children":2624},{"class":638,"line":302},[2625,2629],{"type":606,"tag":636,"props":2626,"children":2627},{"style":651},[2628],{"type":612,"value":889},{"type":606,"tag":636,"props":2630,"children":2631},{"style":663},[2632],{"type":612,"value":2633}," APIError:\n",{"type":606,"tag":636,"props":2635,"children":2636},{"class":638,"line":311},[2637,2641,2645,2650],{"type":606,"tag":636,"props":2638,"children":2639},{"style":669},[2640],{"type":612,"value":912},{"type":606,"tag":636,"props":2642,"children":2643},{"style":663},[2644],{"type":612,"value":666},{"type":606,"tag":636,"props":2646,"children":2647},{"style":763},[2648],{"type":612,"value":2649},"\"General API error occurred\"",{"type":606,"tag":636,"props":2651,"children":2652},{"style":663},[2653],{"type":612,"value":771},{"type":606,"tag":952,"props":2655,"children":2657},{"id":2656},"custom-exception-patterns",[2658],{"type":612,"value":2659},"📋 Custom Exception Patterns",{"type":606,"tag":2661,"props":2662,"children":2663},"table",{},[2664,2688],{"type":606,"tag":2665,"props":2666,"children":2667},"thead",{},[2668],{"type":606,"tag":2669,"props":2670,"children":2671},"tr",{},[2672,2678,2683],{"type":606,"tag":2673,"props":2674,"children":2675},"th",{},[2676],{"type":612,"value":2677},"Pattern",{"type":606,"tag":2673,"props":2679,"children":2680},{},[2681],{"type":612,"value":2682},"Purpose",{"type":606,"tag":2673,"props":2684,"children":2685},{},[2686],{"type":612,"value":2687},"Example",{"type":606,"tag":2689,"props":2690,"children":2691},"tbody",{},[2692,2715,2737,2759],{"type":606,"tag":2669,"props":2693,"children":2694},{},[2695,2701,2706],{"type":606,"tag":2696,"props":2697,"children":2698},"td",{},[2699],{"type":612,"value":2700},"Simple",{"type":606,"tag":2696,"props":2702,"children":2703},{},[2704],{"type":612,"value":2705},"Basic custom error",{"type":606,"tag":2696,"props":2707,"children":2708},{},[2709],{"type":606,"tag":632,"props":2710,"children":2712},{"className":2711},[],[2713],{"type":612,"value":2714},"class CustomError(Exception): pass",{"type":606,"tag":2669,"props":2716,"children":2717},{},[2718,2723,2728],{"type":606,"tag":2696,"props":2719,"children":2720},{},[2721],{"type":612,"value":2722},"With message",{"type":606,"tag":2696,"props":2724,"children":2725},{},[2726],{"type":612,"value":2727},"Custom error message",{"type":606,"tag":2696,"props":2729,"children":2730},{},[2731],{"type":606,"tag":632,"props":2732,"children":2734},{"className":2733},[],[2735],{"type":612,"value":2736},"super().__init__(message)",{"type":606,"tag":2669,"props":2738,"children":2739},{},[2740,2745,2750],{"type":606,"tag":2696,"props":2741,"children":2742},{},[2743],{"type":612,"value":2744},"With data",{"type":606,"tag":2696,"props":2746,"children":2747},{},[2748],{"type":612,"value":2749},"Store additional info",{"type":606,"tag":2696,"props":2751,"children":2752},{},[2753],{"type":606,"tag":632,"props":2754,"children":2756},{"className":2755},[],[2757],{"type":612,"value":2758},"self.code = code",{"type":606,"tag":2669,"props":2760,"children":2761},{},[2762,2767,2772],{"type":606,"tag":2696,"props":2763,"children":2764},{},[2765],{"type":612,"value":2766},"Hierarchy",{"type":606,"tag":2696,"props":2768,"children":2769},{},[2770],{"type":612,"value":2771},"Related error types",{"type":606,"tag":2696,"props":2773,"children":2774},{},[2775],{"type":606,"tag":632,"props":2776,"children":2778},{"className":2777},[],[2779],{"type":612,"value":2780},"class SubError(BaseError):",{"type":606,"tag":952,"props":2782,"children":2784},{"id":2783},"advanced-custom-exceptions",[2785],{"type":612,"value":2786},"🔧 Advanced Custom Exceptions",{"type":606,"tag":1051,"props":2788,"children":2790},{"id":2789},"exception-with-multiple-attributes",[2791],{"type":612,"value":2792},"Exception with Multiple Attributes",{"type":606,"tag":621,"props":2794,"children":2795},{},[2796],{"type":606,"tag":625,"props":2797,"children":2799},{"className":627,"code":2798,"language":629,"meta":8,"style":8},"class ValidationError(Exception):\n    def __init__(self, field, value, message):\n        self.field = field\n        self.value = value\n        self.message = message\n        super().__init__(f\"{field}: {message} (got: {value})\")\n\ndef validate_user_data(name, age, email):\n    if not name:\n        raise ValidationError(\"name\", name, \"Name cannot be empty\")\n    if age \u003C 0:\n        raise ValidationError(\"age\", age, \"Age cannot be negative\")\n    if \"@\" not in email:\n        raise ValidationError(\"email\", email, \"Invalid email format\")\n\ntry:\n    validate_user_data(\"\", 25, \"test@email.com\")\nexcept ValidationError as e:\n    print(f\"Validation failed:\")\n    print(f\"  Field: {e.field}\")\n    print(f\"  Value: {e.value}\")\n    print(f\"  Message: {e.message}\")\n",[2800],{"type":606,"tag":632,"props":2801,"children":2802},{"__ignoreMap":8},[2803,2826,2842,2863,2884,2905,2989,2996,3013,3029,3059,3082,3111,3134,3164,3171,3182,3217,3236,3260,3301,3342],{"type":606,"tag":636,"props":2804,"children":2805},{"class":638,"line":12},[2806,2810,2814,2818,2822],{"type":606,"tag":636,"props":2807,"children":2808},{"style":651},[2809],{"type":612,"value":654},{"type":606,"tag":636,"props":2811,"children":2812},{"style":657},[2813],{"type":612,"value":660},{"type":606,"tag":636,"props":2815,"children":2816},{"style":663},[2817],{"type":612,"value":666},{"type":606,"tag":636,"props":2819,"children":2820},{"style":669},[2821],{"type":612,"value":672},{"type":606,"tag":636,"props":2823,"children":2824},{"style":663},[2825],{"type":612,"value":677},{"type":606,"tag":636,"props":2827,"children":2828},{"class":638,"line":27},[2829,2833,2837],{"type":606,"tag":636,"props":2830,"children":2831},{"style":651},[2832],{"type":612,"value":1594},{"type":606,"tag":636,"props":2834,"children":2835},{"style":669},[2836],{"type":612,"value":1599},{"type":606,"tag":636,"props":2838,"children":2839},{"style":663},[2840],{"type":612,"value":2841},"(self, field, value, message):\n",{"type":606,"tag":636,"props":2843,"children":2844},{"class":638,"line":36},[2845,2849,2854,2858],{"type":606,"tag":636,"props":2846,"children":2847},{"style":669},[2848],{"type":612,"value":1612},{"type":606,"tag":636,"props":2850,"children":2851},{"style":663},[2852],{"type":612,"value":2853},".field ",{"type":606,"tag":636,"props":2855,"children":2856},{"style":651},[2857],{"type":612,"value":862},{"type":606,"tag":636,"props":2859,"children":2860},{"style":663},[2861],{"type":612,"value":2862}," field\n",{"type":606,"tag":636,"props":2864,"children":2865},{"class":638,"line":45},[2866,2870,2875,2879],{"type":606,"tag":636,"props":2867,"children":2868},{"style":669},[2869],{"type":612,"value":1612},{"type":606,"tag":636,"props":2871,"children":2872},{"style":663},[2873],{"type":612,"value":2874},".value ",{"type":606,"tag":636,"props":2876,"children":2877},{"style":651},[2878],{"type":612,"value":862},{"type":606,"tag":636,"props":2880,"children":2881},{"style":663},[2882],{"type":612,"value":2883}," value\n",{"type":606,"tag":636,"props":2885,"children":2886},{"class":638,"line":54},[2887,2891,2896,2900],{"type":606,"tag":636,"props":2888,"children":2889},{"style":669},[2890],{"type":612,"value":1612},{"type":606,"tag":636,"props":2892,"children":2893},{"style":663},[2894],{"type":612,"value":2895},".message ",{"type":606,"tag":636,"props":2897,"children":2898},{"style":651},[2899],{"type":612,"value":862},{"type":606,"tag":636,"props":2901,"children":2902},{"style":663},[2903],{"type":612,"value":2904}," message\n",{"type":606,"tag":636,"props":2906,"children":2907},{"class":638,"line":63},[2908,2912,2916,2920,2924,2928,2932,2936,2941,2945,2949,2953,2958,2962,2967,2971,2976,2980,2985],{"type":606,"tag":636,"props":2909,"children":2910},{"style":669},[2911],{"type":612,"value":1713},{"type":606,"tag":636,"props":2913,"children":2914},{"style":663},[2915],{"type":612,"value":1718},{"type":606,"tag":636,"props":2917,"children":2918},{"style":669},[2919],{"type":612,"value":1723},{"type":606,"tag":636,"props":2921,"children":2922},{"style":663},[2923],{"type":612,"value":666},{"type":606,"tag":636,"props":2925,"children":2926},{"style":651},[2927],{"type":612,"value":921},{"type":606,"tag":636,"props":2929,"children":2930},{"style":763},[2931],{"type":612,"value":946},{"type":606,"tag":636,"props":2933,"children":2934},{"style":669},[2935],{"type":612,"value":931},{"type":606,"tag":636,"props":2937,"children":2938},{"style":663},[2939],{"type":612,"value":2940},"field",{"type":606,"tag":636,"props":2942,"children":2943},{"style":669},[2944],{"type":612,"value":941},{"type":606,"tag":636,"props":2946,"children":2947},{"style":763},[2948],{"type":612,"value":1787},{"type":606,"tag":636,"props":2950,"children":2951},{"style":669},[2952],{"type":612,"value":931},{"type":606,"tag":636,"props":2954,"children":2955},{"style":663},[2956],{"type":612,"value":2957},"message",{"type":606,"tag":636,"props":2959,"children":2960},{"style":669},[2961],{"type":612,"value":941},{"type":606,"tag":636,"props":2963,"children":2964},{"style":763},[2965],{"type":612,"value":2966}," (got: ",{"type":606,"tag":636,"props":2968,"children":2969},{"style":669},[2970],{"type":612,"value":931},{"type":606,"tag":636,"props":2972,"children":2973},{"style":663},[2974],{"type":612,"value":2975},"value",{"type":606,"tag":636,"props":2977,"children":2978},{"style":669},[2979],{"type":612,"value":941},{"type":606,"tag":636,"props":2981,"children":2982},{"style":763},[2983],{"type":612,"value":2984},")\"",{"type":606,"tag":636,"props":2986,"children":2987},{"style":663},[2988],{"type":612,"value":771},{"type":606,"tag":636,"props":2990,"children":2991},{"class":638,"line":72},[2992],{"type":606,"tag":636,"props":2993,"children":2994},{"emptyLinePlaceholder":13},[2995],{"type":612,"value":693},{"type":606,"tag":636,"props":2997,"children":2998},{"class":638,"line":81},[2999,3003,3008],{"type":606,"tag":636,"props":3000,"children":3001},{"style":651},[3002],{"type":612,"value":709},{"type":606,"tag":636,"props":3004,"children":3005},{"style":657},[3006],{"type":612,"value":3007}," validate_user_data",{"type":606,"tag":636,"props":3009,"children":3010},{"style":663},[3011],{"type":612,"value":3012},"(name, age, email):\n",{"type":606,"tag":636,"props":3014,"children":3015},{"class":638,"line":774},[3016,3020,3024],{"type":606,"tag":636,"props":3017,"children":3018},{"style":651},[3019],{"type":612,"value":727},{"type":606,"tag":636,"props":3021,"children":3022},{"style":651},[3023],{"type":612,"value":1192},{"type":606,"tag":636,"props":3025,"children":3026},{"style":663},[3027],{"type":612,"value":3028}," name:\n",{"type":606,"tag":636,"props":3030,"children":3031},{"class":638,"line":99},[3032,3036,3040,3045,3050,3055],{"type":606,"tag":636,"props":3033,"children":3034},{"style":651},[3035],{"type":612,"value":755},{"type":606,"tag":636,"props":3037,"children":3038},{"style":663},[3039],{"type":612,"value":760},{"type":606,"tag":636,"props":3041,"children":3042},{"style":763},[3043],{"type":612,"value":3044},"\"name\"",{"type":606,"tag":636,"props":3046,"children":3047},{"style":663},[3048],{"type":612,"value":3049},", name, ",{"type":606,"tag":636,"props":3051,"children":3052},{"style":763},[3053],{"type":612,"value":3054},"\"Name cannot be empty\"",{"type":606,"tag":636,"props":3056,"children":3057},{"style":663},[3058],{"type":612,"value":771},{"type":606,"tag":636,"props":3060,"children":3061},{"class":638,"line":108},[3062,3066,3070,3074,3078],{"type":606,"tag":636,"props":3063,"children":3064},{"style":651},[3065],{"type":612,"value":727},{"type":606,"tag":636,"props":3067,"children":3068},{"style":663},[3069],{"type":612,"value":732},{"type":606,"tag":636,"props":3071,"children":3072},{"style":651},[3073],{"type":612,"value":737},{"type":606,"tag":636,"props":3075,"children":3076},{"style":669},[3077],{"type":612,"value":742},{"type":606,"tag":636,"props":3079,"children":3080},{"style":663},[3081],{"type":612,"value":747},{"type":606,"tag":636,"props":3083,"children":3084},{"class":638,"line":117},[3085,3089,3093,3098,3103,3107],{"type":606,"tag":636,"props":3086,"children":3087},{"style":651},[3088],{"type":612,"value":755},{"type":606,"tag":636,"props":3090,"children":3091},{"style":663},[3092],{"type":612,"value":760},{"type":606,"tag":636,"props":3094,"children":3095},{"style":763},[3096],{"type":612,"value":3097},"\"age\"",{"type":606,"tag":636,"props":3099,"children":3100},{"style":663},[3101],{"type":612,"value":3102},", age, ",{"type":606,"tag":636,"props":3104,"children":3105},{"style":763},[3106],{"type":612,"value":766},{"type":606,"tag":636,"props":3108,"children":3109},{"style":663},[3110],{"type":612,"value":771},{"type":606,"tag":636,"props":3112,"children":3113},{"class":638,"line":126},[3114,3118,3122,3126,3130],{"type":606,"tag":636,"props":3115,"children":3116},{"style":651},[3117],{"type":612,"value":727},{"type":606,"tag":636,"props":3119,"children":3120},{"style":763},[3121],{"type":612,"value":1187},{"type":606,"tag":636,"props":3123,"children":3124},{"style":651},[3125],{"type":612,"value":1192},{"type":606,"tag":636,"props":3127,"children":3128},{"style":651},[3129],{"type":612,"value":1197},{"type":606,"tag":636,"props":3131,"children":3132},{"style":663},[3133],{"type":612,"value":1202},{"type":606,"tag":636,"props":3135,"children":3136},{"class":638,"line":135},[3137,3141,3145,3150,3155,3160],{"type":606,"tag":636,"props":3138,"children":3139},{"style":651},[3140],{"type":612,"value":755},{"type":606,"tag":636,"props":3142,"children":3143},{"style":663},[3144],{"type":612,"value":760},{"type":606,"tag":636,"props":3146,"children":3147},{"style":763},[3148],{"type":612,"value":3149},"\"email\"",{"type":606,"tag":636,"props":3151,"children":3152},{"style":663},[3153],{"type":612,"value":3154},", email, ",{"type":606,"tag":636,"props":3156,"children":3157},{"style":763},[3158],{"type":612,"value":3159},"\"Invalid email format\"",{"type":606,"tag":636,"props":3161,"children":3162},{"style":663},[3163],{"type":612,"value":771},{"type":606,"tag":636,"props":3165,"children":3166},{"class":638,"line":144},[3167],{"type":606,"tag":636,"props":3168,"children":3169},{"emptyLinePlaceholder":13},[3170],{"type":612,"value":693},{"type":606,"tag":636,"props":3172,"children":3173},{"class":638,"line":153},[3174,3178],{"type":606,"tag":636,"props":3175,"children":3176},{"style":651},[3177],{"type":612,"value":845},{"type":606,"tag":636,"props":3179,"children":3180},{"style":663},[3181],{"type":612,"value":747},{"type":606,"tag":636,"props":3183,"children":3184},{"class":638,"line":163},[3185,3190,3195,3199,3204,3208,3213],{"type":606,"tag":636,"props":3186,"children":3187},{"style":663},[3188],{"type":612,"value":3189},"    validate_user_data(",{"type":606,"tag":636,"props":3191,"children":3192},{"style":763},[3193],{"type":612,"value":3194},"\"\"",{"type":606,"tag":636,"props":3196,"children":3197},{"style":663},[3198],{"type":612,"value":1796},{"type":606,"tag":636,"props":3200,"children":3201},{"style":669},[3202],{"type":612,"value":3203},"25",{"type":606,"tag":636,"props":3205,"children":3206},{"style":663},[3207],{"type":612,"value":1796},{"type":606,"tag":636,"props":3209,"children":3210},{"style":763},[3211],{"type":612,"value":3212},"\"test@email.com\"",{"type":606,"tag":636,"props":3214,"children":3215},{"style":663},[3216],{"type":612,"value":771},{"type":606,"tag":636,"props":3218,"children":3219},{"class":638,"line":172},[3220,3224,3228,3232],{"type":606,"tag":636,"props":3221,"children":3222},{"style":651},[3223],{"type":612,"value":889},{"type":606,"tag":636,"props":3225,"children":3226},{"style":663},[3227],{"type":612,"value":894},{"type":606,"tag":636,"props":3229,"children":3230},{"style":651},[3231],{"type":612,"value":899},{"type":606,"tag":636,"props":3233,"children":3234},{"style":663},[3235],{"type":612,"value":904},{"type":606,"tag":636,"props":3237,"children":3238},{"class":638,"line":181},[3239,3243,3247,3251,3256],{"type":606,"tag":636,"props":3240,"children":3241},{"style":669},[3242],{"type":612,"value":912},{"type":606,"tag":636,"props":3244,"children":3245},{"style":663},[3246],{"type":612,"value":666},{"type":606,"tag":636,"props":3248,"children":3249},{"style":651},[3250],{"type":612,"value":921},{"type":606,"tag":636,"props":3252,"children":3253},{"style":763},[3254],{"type":612,"value":3255},"\"Validation failed:\"",{"type":606,"tag":636,"props":3257,"children":3258},{"style":663},[3259],{"type":612,"value":771},{"type":606,"tag":636,"props":3261,"children":3262},{"class":638,"line":190},[3263,3267,3271,3275,3280,3284,3289,3293,3297],{"type":606,"tag":636,"props":3264,"children":3265},{"style":669},[3266],{"type":612,"value":912},{"type":606,"tag":636,"props":3268,"children":3269},{"style":663},[3270],{"type":612,"value":666},{"type":606,"tag":636,"props":3272,"children":3273},{"style":651},[3274],{"type":612,"value":921},{"type":606,"tag":636,"props":3276,"children":3277},{"style":763},[3278],{"type":612,"value":3279},"\"  Field: ",{"type":606,"tag":636,"props":3281,"children":3282},{"style":669},[3283],{"type":612,"value":931},{"type":606,"tag":636,"props":3285,"children":3286},{"style":663},[3287],{"type":612,"value":3288},"e.field",{"type":606,"tag":636,"props":3290,"children":3291},{"style":669},[3292],{"type":612,"value":941},{"type":606,"tag":636,"props":3294,"children":3295},{"style":763},[3296],{"type":612,"value":946},{"type":606,"tag":636,"props":3298,"children":3299},{"style":663},[3300],{"type":612,"value":771},{"type":606,"tag":636,"props":3302,"children":3303},{"class":638,"line":199},[3304,3308,3312,3316,3321,3325,3330,3334,3338],{"type":606,"tag":636,"props":3305,"children":3306},{"style":669},[3307],{"type":612,"value":912},{"type":606,"tag":636,"props":3309,"children":3310},{"style":663},[3311],{"type":612,"value":666},{"type":606,"tag":636,"props":3313,"children":3314},{"style":651},[3315],{"type":612,"value":921},{"type":606,"tag":636,"props":3317,"children":3318},{"style":763},[3319],{"type":612,"value":3320},"\"  Value: ",{"type":606,"tag":636,"props":3322,"children":3323},{"style":669},[3324],{"type":612,"value":931},{"type":606,"tag":636,"props":3326,"children":3327},{"style":663},[3328],{"type":612,"value":3329},"e.value",{"type":606,"tag":636,"props":3331,"children":3332},{"style":669},[3333],{"type":612,"value":941},{"type":606,"tag":636,"props":3335,"children":3336},{"style":763},[3337],{"type":612,"value":946},{"type":606,"tag":636,"props":3339,"children":3340},{"style":663},[3341],{"type":612,"value":771},{"type":606,"tag":636,"props":3343,"children":3344},{"class":638,"line":208},[3345,3349,3353,3357,3362,3366,3371,3375,3379],{"type":606,"tag":636,"props":3346,"children":3347},{"style":669},[3348],{"type":612,"value":912},{"type":606,"tag":636,"props":3350,"children":3351},{"style":663},[3352],{"type":612,"value":666},{"type":606,"tag":636,"props":3354,"children":3355},{"style":651},[3356],{"type":612,"value":921},{"type":606,"tag":636,"props":3358,"children":3359},{"style":763},[3360],{"type":612,"value":3361},"\"  Message: ",{"type":606,"tag":636,"props":3363,"children":3364},{"style":669},[3365],{"type":612,"value":931},{"type":606,"tag":636,"props":3367,"children":3368},{"style":663},[3369],{"type":612,"value":3370},"e.message",{"type":606,"tag":636,"props":3372,"children":3373},{"style":669},[3374],{"type":612,"value":941},{"type":606,"tag":636,"props":3376,"children":3377},{"style":763},[3378],{"type":612,"value":946},{"type":606,"tag":636,"props":3380,"children":3381},{"style":663},[3382],{"type":612,"value":771},{"type":606,"tag":1051,"props":3384,"children":3386},{"id":3385},"exception-with-error-codes",[3387],{"type":612,"value":3388},"Exception with Error Codes",{"type":606,"tag":621,"props":3390,"children":3391},{},[3392],{"type":606,"tag":625,"props":3393,"children":3395},{"className":627,"code":3394,"language":629,"meta":8,"style":8},"class BusinessError(Exception):\n    def __init__(self, code, message):\n        self.code = code\n        self.message = message\n        super().__init__(f\"Error {code}: {message}\")\n\n# Define specific error codes\nINSUFFICIENT_FUNDS = 1001\nACCOUNT_LOCKED = 1002\nINVALID_TRANSACTION = 1003\n\ndef process_payment(amount, balance, account_status):\n    if account_status == \"locked\":\n        raise BusinessError(ACCOUNT_LOCKED, \"Account is locked\")\n    if amount > balance:\n        raise BusinessError(INSUFFICIENT_FUNDS, \"Not enough funds\")\n    if amount \u003C= 0:\n        raise BusinessError(INVALID_TRANSACTION, \"Invalid transaction amount\")\n\ntry:\n    process_payment(100, 50, \"active\")\nexcept BusinessError as e:\n    print(f\"Payment failed: {e}\")\n    print(f\"Error code: {e.code}\")\n    \n    if e.code == INSUFFICIENT_FUNDS:\n        print(\"Consider making a smaller payment\")\n    elif e.code == ACCOUNT_LOCKED:\n        print(\"Contact support to unlock account\")\n",[3396],{"type":606,"tag":632,"props":3397,"children":3398},{"__ignoreMap":8},[3399,3423,3439,3460,3479,3543,3550,3558,3576,3593,3610,3617,3634,3659,3688,3709,3737,3761,3789,3796,3807,3842,3862,3902,3943,3950,3975,3996,4020],{"type":606,"tag":636,"props":3400,"children":3401},{"class":638,"line":12},[3402,3406,3411,3415,3419],{"type":606,"tag":636,"props":3403,"children":3404},{"style":651},[3405],{"type":612,"value":654},{"type":606,"tag":636,"props":3407,"children":3408},{"style":657},[3409],{"type":612,"value":3410}," BusinessError",{"type":606,"tag":636,"props":3412,"children":3413},{"style":663},[3414],{"type":612,"value":666},{"type":606,"tag":636,"props":3416,"children":3417},{"style":669},[3418],{"type":612,"value":672},{"type":606,"tag":636,"props":3420,"children":3421},{"style":663},[3422],{"type":612,"value":677},{"type":606,"tag":636,"props":3424,"children":3425},{"class":638,"line":27},[3426,3430,3434],{"type":606,"tag":636,"props":3427,"children":3428},{"style":651},[3429],{"type":612,"value":1594},{"type":606,"tag":636,"props":3431,"children":3432},{"style":669},[3433],{"type":612,"value":1599},{"type":606,"tag":636,"props":3435,"children":3436},{"style":663},[3437],{"type":612,"value":3438},"(self, code, message):\n",{"type":606,"tag":636,"props":3440,"children":3441},{"class":638,"line":36},[3442,3446,3451,3455],{"type":606,"tag":636,"props":3443,"children":3444},{"style":669},[3445],{"type":612,"value":1612},{"type":606,"tag":636,"props":3447,"children":3448},{"style":663},[3449],{"type":612,"value":3450},".code ",{"type":606,"tag":636,"props":3452,"children":3453},{"style":651},[3454],{"type":612,"value":862},{"type":606,"tag":636,"props":3456,"children":3457},{"style":663},[3458],{"type":612,"value":3459}," code\n",{"type":606,"tag":636,"props":3461,"children":3462},{"class":638,"line":45},[3463,3467,3471,3475],{"type":606,"tag":636,"props":3464,"children":3465},{"style":669},[3466],{"type":612,"value":1612},{"type":606,"tag":636,"props":3468,"children":3469},{"style":663},[3470],{"type":612,"value":2895},{"type":606,"tag":636,"props":3472,"children":3473},{"style":651},[3474],{"type":612,"value":862},{"type":606,"tag":636,"props":3476,"children":3477},{"style":663},[3478],{"type":612,"value":2904},{"type":606,"tag":636,"props":3480,"children":3481},{"class":638,"line":54},[3482,3486,3490,3494,3498,3502,3507,3511,3515,3519,3523,3527,3531,3535,3539],{"type":606,"tag":636,"props":3483,"children":3484},{"style":669},[3485],{"type":612,"value":1713},{"type":606,"tag":636,"props":3487,"children":3488},{"style":663},[3489],{"type":612,"value":1718},{"type":606,"tag":636,"props":3491,"children":3492},{"style":669},[3493],{"type":612,"value":1723},{"type":606,"tag":636,"props":3495,"children":3496},{"style":663},[3497],{"type":612,"value":666},{"type":606,"tag":636,"props":3499,"children":3500},{"style":651},[3501],{"type":612,"value":921},{"type":606,"tag":636,"props":3503,"children":3504},{"style":763},[3505],{"type":612,"value":3506},"\"Error ",{"type":606,"tag":636,"props":3508,"children":3509},{"style":669},[3510],{"type":612,"value":931},{"type":606,"tag":636,"props":3512,"children":3513},{"style":663},[3514],{"type":612,"value":632},{"type":606,"tag":636,"props":3516,"children":3517},{"style":669},[3518],{"type":612,"value":941},{"type":606,"tag":636,"props":3520,"children":3521},{"style":763},[3522],{"type":612,"value":1787},{"type":606,"tag":636,"props":3524,"children":3525},{"style":669},[3526],{"type":612,"value":931},{"type":606,"tag":636,"props":3528,"children":3529},{"style":663},[3530],{"type":612,"value":2957},{"type":606,"tag":636,"props":3532,"children":3533},{"style":669},[3534],{"type":612,"value":941},{"type":606,"tag":636,"props":3536,"children":3537},{"style":763},[3538],{"type":612,"value":946},{"type":606,"tag":636,"props":3540,"children":3541},{"style":663},[3542],{"type":612,"value":771},{"type":606,"tag":636,"props":3544,"children":3545},{"class":638,"line":63},[3546],{"type":606,"tag":636,"props":3547,"children":3548},{"emptyLinePlaceholder":13},[3549],{"type":612,"value":693},{"type":606,"tag":636,"props":3551,"children":3552},{"class":638,"line":72},[3553],{"type":606,"tag":636,"props":3554,"children":3555},{"style":642},[3556],{"type":612,"value":3557},"# Define specific error codes\n",{"type":606,"tag":636,"props":3559,"children":3560},{"class":638,"line":81},[3561,3566,3571],{"type":606,"tag":636,"props":3562,"children":3563},{"style":669},[3564],{"type":612,"value":3565},"INSUFFICIENT_FUNDS",{"type":606,"tag":636,"props":3567,"children":3568},{"style":651},[3569],{"type":612,"value":3570}," =",{"type":606,"tag":636,"props":3572,"children":3573},{"style":669},[3574],{"type":612,"value":3575}," 1001\n",{"type":606,"tag":636,"props":3577,"children":3578},{"class":638,"line":774},[3579,3584,3588],{"type":606,"tag":636,"props":3580,"children":3581},{"style":669},[3582],{"type":612,"value":3583},"ACCOUNT_LOCKED",{"type":606,"tag":636,"props":3585,"children":3586},{"style":651},[3587],{"type":612,"value":3570},{"type":606,"tag":636,"props":3589,"children":3590},{"style":669},[3591],{"type":612,"value":3592}," 1002\n",{"type":606,"tag":636,"props":3594,"children":3595},{"class":638,"line":99},[3596,3601,3605],{"type":606,"tag":636,"props":3597,"children":3598},{"style":669},[3599],{"type":612,"value":3600},"INVALID_TRANSACTION",{"type":606,"tag":636,"props":3602,"children":3603},{"style":651},[3604],{"type":612,"value":3570},{"type":606,"tag":636,"props":3606,"children":3607},{"style":669},[3608],{"type":612,"value":3609}," 1003\n",{"type":606,"tag":636,"props":3611,"children":3612},{"class":638,"line":108},[3613],{"type":606,"tag":636,"props":3614,"children":3615},{"emptyLinePlaceholder":13},[3616],{"type":612,"value":693},{"type":606,"tag":636,"props":3618,"children":3619},{"class":638,"line":117},[3620,3624,3629],{"type":606,"tag":636,"props":3621,"children":3622},{"style":651},[3623],{"type":612,"value":709},{"type":606,"tag":636,"props":3625,"children":3626},{"style":657},[3627],{"type":612,"value":3628}," process_payment",{"type":606,"tag":636,"props":3630,"children":3631},{"style":663},[3632],{"type":612,"value":3633},"(amount, balance, account_status):\n",{"type":606,"tag":636,"props":3635,"children":3636},{"class":638,"line":126},[3637,3641,3646,3650,3655],{"type":606,"tag":636,"props":3638,"children":3639},{"style":651},[3640],{"type":612,"value":727},{"type":606,"tag":636,"props":3642,"children":3643},{"style":663},[3644],{"type":612,"value":3645}," account_status ",{"type":606,"tag":636,"props":3647,"children":3648},{"style":651},[3649],{"type":612,"value":2372},{"type":606,"tag":636,"props":3651,"children":3652},{"style":763},[3653],{"type":612,"value":3654}," \"locked\"",{"type":606,"tag":636,"props":3656,"children":3657},{"style":663},[3658],{"type":612,"value":747},{"type":606,"tag":636,"props":3660,"children":3661},{"class":638,"line":135},[3662,3666,3671,3675,3679,3684],{"type":606,"tag":636,"props":3663,"children":3664},{"style":651},[3665],{"type":612,"value":755},{"type":606,"tag":636,"props":3667,"children":3668},{"style":663},[3669],{"type":612,"value":3670}," BusinessError(",{"type":606,"tag":636,"props":3672,"children":3673},{"style":669},[3674],{"type":612,"value":3583},{"type":606,"tag":636,"props":3676,"children":3677},{"style":663},[3678],{"type":612,"value":1796},{"type":606,"tag":636,"props":3680,"children":3681},{"style":763},[3682],{"type":612,"value":3683},"\"Account is locked\"",{"type":606,"tag":636,"props":3685,"children":3686},{"style":663},[3687],{"type":612,"value":771},{"type":606,"tag":636,"props":3689,"children":3690},{"class":638,"line":144},[3691,3695,3700,3704],{"type":606,"tag":636,"props":3692,"children":3693},{"style":651},[3694],{"type":612,"value":727},{"type":606,"tag":636,"props":3696,"children":3697},{"style":663},[3698],{"type":612,"value":3699}," amount ",{"type":606,"tag":636,"props":3701,"children":3702},{"style":651},[3703],{"type":612,"value":788},{"type":606,"tag":636,"props":3705,"children":3706},{"style":663},[3707],{"type":612,"value":3708}," balance:\n",{"type":606,"tag":636,"props":3710,"children":3711},{"class":638,"line":153},[3712,3716,3720,3724,3728,3733],{"type":606,"tag":636,"props":3713,"children":3714},{"style":651},[3715],{"type":612,"value":755},{"type":606,"tag":636,"props":3717,"children":3718},{"style":663},[3719],{"type":612,"value":3670},{"type":606,"tag":636,"props":3721,"children":3722},{"style":669},[3723],{"type":612,"value":3565},{"type":606,"tag":636,"props":3725,"children":3726},{"style":663},[3727],{"type":612,"value":1796},{"type":606,"tag":636,"props":3729,"children":3730},{"style":763},[3731],{"type":612,"value":3732},"\"Not enough funds\"",{"type":606,"tag":636,"props":3734,"children":3735},{"style":663},[3736],{"type":612,"value":771},{"type":606,"tag":636,"props":3738,"children":3739},{"class":638,"line":163},[3740,3744,3748,3753,3757],{"type":606,"tag":636,"props":3741,"children":3742},{"style":651},[3743],{"type":612,"value":727},{"type":606,"tag":636,"props":3745,"children":3746},{"style":663},[3747],{"type":612,"value":3699},{"type":606,"tag":636,"props":3749,"children":3750},{"style":651},[3751],{"type":612,"value":3752},"\u003C=",{"type":606,"tag":636,"props":3754,"children":3755},{"style":669},[3756],{"type":612,"value":742},{"type":606,"tag":636,"props":3758,"children":3759},{"style":663},[3760],{"type":612,"value":747},{"type":606,"tag":636,"props":3762,"children":3763},{"class":638,"line":172},[3764,3768,3772,3776,3780,3785],{"type":606,"tag":636,"props":3765,"children":3766},{"style":651},[3767],{"type":612,"value":755},{"type":606,"tag":636,"props":3769,"children":3770},{"style":663},[3771],{"type":612,"value":3670},{"type":606,"tag":636,"props":3773,"children":3774},{"style":669},[3775],{"type":612,"value":3600},{"type":606,"tag":636,"props":3777,"children":3778},{"style":663},[3779],{"type":612,"value":1796},{"type":606,"tag":636,"props":3781,"children":3782},{"style":763},[3783],{"type":612,"value":3784},"\"Invalid transaction amount\"",{"type":606,"tag":636,"props":3786,"children":3787},{"style":663},[3788],{"type":612,"value":771},{"type":606,"tag":636,"props":3790,"children":3791},{"class":638,"line":181},[3792],{"type":606,"tag":636,"props":3793,"children":3794},{"emptyLinePlaceholder":13},[3795],{"type":612,"value":693},{"type":606,"tag":636,"props":3797,"children":3798},{"class":638,"line":190},[3799,3803],{"type":606,"tag":636,"props":3800,"children":3801},{"style":651},[3802],{"type":612,"value":845},{"type":606,"tag":636,"props":3804,"children":3805},{"style":663},[3806],{"type":612,"value":747},{"type":606,"tag":636,"props":3808,"children":3809},{"class":638,"line":199},[3810,3815,3820,3824,3829,3833,3838],{"type":606,"tag":636,"props":3811,"children":3812},{"style":663},[3813],{"type":612,"value":3814},"    process_payment(",{"type":606,"tag":636,"props":3816,"children":3817},{"style":669},[3818],{"type":612,"value":3819},"100",{"type":606,"tag":636,"props":3821,"children":3822},{"style":663},[3823],{"type":612,"value":1796},{"type":606,"tag":636,"props":3825,"children":3826},{"style":669},[3827],{"type":612,"value":3828},"50",{"type":606,"tag":636,"props":3830,"children":3831},{"style":663},[3832],{"type":612,"value":1796},{"type":606,"tag":636,"props":3834,"children":3835},{"style":763},[3836],{"type":612,"value":3837},"\"active\"",{"type":606,"tag":636,"props":3839,"children":3840},{"style":663},[3841],{"type":612,"value":771},{"type":606,"tag":636,"props":3843,"children":3844},{"class":638,"line":208},[3845,3849,3854,3858],{"type":606,"tag":636,"props":3846,"children":3847},{"style":651},[3848],{"type":612,"value":889},{"type":606,"tag":636,"props":3850,"children":3851},{"style":663},[3852],{"type":612,"value":3853}," BusinessError ",{"type":606,"tag":636,"props":3855,"children":3856},{"style":651},[3857],{"type":612,"value":899},{"type":606,"tag":636,"props":3859,"children":3860},{"style":663},[3861],{"type":612,"value":904},{"type":606,"tag":636,"props":3863,"children":3864},{"class":638,"line":217},[3865,3869,3873,3877,3882,3886,3890,3894,3898],{"type":606,"tag":636,"props":3866,"children":3867},{"style":669},[3868],{"type":612,"value":912},{"type":606,"tag":636,"props":3870,"children":3871},{"style":663},[3872],{"type":612,"value":666},{"type":606,"tag":636,"props":3874,"children":3875},{"style":651},[3876],{"type":612,"value":921},{"type":606,"tag":636,"props":3878,"children":3879},{"style":763},[3880],{"type":612,"value":3881},"\"Payment failed: ",{"type":606,"tag":636,"props":3883,"children":3884},{"style":669},[3885],{"type":612,"value":931},{"type":606,"tag":636,"props":3887,"children":3888},{"style":663},[3889],{"type":612,"value":936},{"type":606,"tag":636,"props":3891,"children":3892},{"style":669},[3893],{"type":612,"value":941},{"type":606,"tag":636,"props":3895,"children":3896},{"style":763},[3897],{"type":612,"value":946},{"type":606,"tag":636,"props":3899,"children":3900},{"style":663},[3901],{"type":612,"value":771},{"type":606,"tag":636,"props":3903,"children":3904},{"class":638,"line":227},[3905,3909,3913,3917,3922,3926,3931,3935,3939],{"type":606,"tag":636,"props":3906,"children":3907},{"style":669},[3908],{"type":612,"value":912},{"type":606,"tag":636,"props":3910,"children":3911},{"style":663},[3912],{"type":612,"value":666},{"type":606,"tag":636,"props":3914,"children":3915},{"style":651},[3916],{"type":612,"value":921},{"type":606,"tag":636,"props":3918,"children":3919},{"style":763},[3920],{"type":612,"value":3921},"\"Error code: ",{"type":606,"tag":636,"props":3923,"children":3924},{"style":669},[3925],{"type":612,"value":931},{"type":606,"tag":636,"props":3927,"children":3928},{"style":663},[3929],{"type":612,"value":3930},"e.code",{"type":606,"tag":636,"props":3932,"children":3933},{"style":669},[3934],{"type":612,"value":941},{"type":606,"tag":636,"props":3936,"children":3937},{"style":763},[3938],{"type":612,"value":946},{"type":606,"tag":636,"props":3940,"children":3941},{"style":663},[3942],{"type":612,"value":771},{"type":606,"tag":636,"props":3944,"children":3945},{"class":638,"line":236},[3946],{"type":606,"tag":636,"props":3947,"children":3948},{"style":663},[3949],{"type":612,"value":1866},{"type":606,"tag":636,"props":3951,"children":3952},{"class":638,"line":245},[3953,3957,3962,3966,3971],{"type":606,"tag":636,"props":3954,"children":3955},{"style":651},[3956],{"type":612,"value":727},{"type":606,"tag":636,"props":3958,"children":3959},{"style":663},[3960],{"type":612,"value":3961}," e.code ",{"type":606,"tag":636,"props":3963,"children":3964},{"style":651},[3965],{"type":612,"value":2372},{"type":606,"tag":636,"props":3967,"children":3968},{"style":669},[3969],{"type":612,"value":3970}," INSUFFICIENT_FUNDS",{"type":606,"tag":636,"props":3972,"children":3973},{"style":663},[3974],{"type":612,"value":747},{"type":606,"tag":636,"props":3976,"children":3977},{"class":638,"line":254},[3978,3983,3987,3992],{"type":606,"tag":636,"props":3979,"children":3980},{"style":669},[3981],{"type":612,"value":3982},"        print",{"type":606,"tag":636,"props":3984,"children":3985},{"style":663},[3986],{"type":612,"value":666},{"type":606,"tag":636,"props":3988,"children":3989},{"style":763},[3990],{"type":612,"value":3991},"\"Consider making a smaller payment\"",{"type":606,"tag":636,"props":3993,"children":3994},{"style":663},[3995],{"type":612,"value":771},{"type":606,"tag":636,"props":3997,"children":3998},{"class":638,"line":263},[3999,4003,4007,4011,4016],{"type":606,"tag":636,"props":4000,"children":4001},{"style":651},[4002],{"type":612,"value":2410},{"type":606,"tag":636,"props":4004,"children":4005},{"style":663},[4006],{"type":612,"value":3961},{"type":606,"tag":636,"props":4008,"children":4009},{"style":651},[4010],{"type":612,"value":2372},{"type":606,"tag":636,"props":4012,"children":4013},{"style":669},[4014],{"type":612,"value":4015}," ACCOUNT_LOCKED",{"type":606,"tag":636,"props":4017,"children":4018},{"style":663},[4019],{"type":612,"value":747},{"type":606,"tag":636,"props":4021,"children":4022},{"class":638,"line":272},[4023,4027,4031,4036],{"type":606,"tag":636,"props":4024,"children":4025},{"style":669},[4026],{"type":612,"value":3982},{"type":606,"tag":636,"props":4028,"children":4029},{"style":663},[4030],{"type":612,"value":666},{"type":606,"tag":636,"props":4032,"children":4033},{"style":763},[4034],{"type":612,"value":4035},"\"Contact support to unlock account\"",{"type":606,"tag":636,"props":4037,"children":4038},{"style":663},[4039],{"type":612,"value":771},{"type":606,"tag":1051,"props":4041,"children":4043},{"id":4042},"re-raising-exceptions",[4044],{"type":612,"value":4045},"Re-raising Exceptions",{"type":606,"tag":621,"props":4047,"children":4048},{},[4049],{"type":606,"tag":625,"props":4050,"children":4052},{"className":627,"code":4051,"language":629,"meta":8,"style":8},"class DatabaseError(Exception):\n    pass\n\nclass ConnectionError(DatabaseError):\n    pass\n\ndef connect_to_database():\n    # Simulate connection error\n    raise ConnectionError(\"Cannot connect to database\")\n\ndef get_user_data(user_id):\n    try:\n        connect_to_database()\n        return {\"id\": user_id, \"name\": \"User\"}\n    except ConnectionError:\n        print(\"Database connection failed, using cache\")\n        raise  # Re-raise the exception\n\ntry:\n    user = get_user_data(123)\nexcept DatabaseError as e:\n    print(f\"Database operation failed: {e}\")\n",[4053],{"type":606,"tag":632,"props":4054,"children":4055},{"__ignoreMap":8},[4056,4080,4087,4094,4119,4126,4133,4150,4158,4183,4190,4207,4219,4227,4266,4282,4302,4314,4321,4332,4358,4378],{"type":606,"tag":636,"props":4057,"children":4058},{"class":638,"line":12},[4059,4063,4068,4072,4076],{"type":606,"tag":636,"props":4060,"children":4061},{"style":651},[4062],{"type":612,"value":654},{"type":606,"tag":636,"props":4064,"children":4065},{"style":657},[4066],{"type":612,"value":4067}," DatabaseError",{"type":606,"tag":636,"props":4069,"children":4070},{"style":663},[4071],{"type":612,"value":666},{"type":606,"tag":636,"props":4073,"children":4074},{"style":669},[4075],{"type":612,"value":672},{"type":606,"tag":636,"props":4077,"children":4078},{"style":663},[4079],{"type":612,"value":677},{"type":606,"tag":636,"props":4081,"children":4082},{"class":638,"line":27},[4083],{"type":606,"tag":636,"props":4084,"children":4085},{"style":651},[4086],{"type":612,"value":685},{"type":606,"tag":636,"props":4088,"children":4089},{"class":638,"line":36},[4090],{"type":606,"tag":636,"props":4091,"children":4092},{"emptyLinePlaceholder":13},[4093],{"type":612,"value":693},{"type":606,"tag":636,"props":4095,"children":4096},{"class":638,"line":45},[4097,4101,4106,4110,4115],{"type":606,"tag":636,"props":4098,"children":4099},{"style":651},[4100],{"type":612,"value":654},{"type":606,"tag":636,"props":4102,"children":4103},{"style":669},[4104],{"type":612,"value":4105}," ConnectionError",{"type":606,"tag":636,"props":4107,"children":4108},{"style":663},[4109],{"type":612,"value":666},{"type":606,"tag":636,"props":4111,"children":4112},{"style":657},[4113],{"type":612,"value":4114},"DatabaseError",{"type":606,"tag":636,"props":4116,"children":4117},{"style":663},[4118],{"type":612,"value":677},{"type":606,"tag":636,"props":4120,"children":4121},{"class":638,"line":54},[4122],{"type":606,"tag":636,"props":4123,"children":4124},{"style":651},[4125],{"type":612,"value":685},{"type":606,"tag":636,"props":4127,"children":4128},{"class":638,"line":63},[4129],{"type":606,"tag":636,"props":4130,"children":4131},{"emptyLinePlaceholder":13},[4132],{"type":612,"value":693},{"type":606,"tag":636,"props":4134,"children":4135},{"class":638,"line":72},[4136,4140,4145],{"type":606,"tag":636,"props":4137,"children":4138},{"style":651},[4139],{"type":612,"value":709},{"type":606,"tag":636,"props":4141,"children":4142},{"style":657},[4143],{"type":612,"value":4144}," connect_to_database",{"type":606,"tag":636,"props":4146,"children":4147},{"style":663},[4148],{"type":612,"value":4149},"():\n",{"type":606,"tag":636,"props":4151,"children":4152},{"class":638,"line":81},[4153],{"type":606,"tag":636,"props":4154,"children":4155},{"style":642},[4156],{"type":612,"value":4157},"    # Simulate connection error\n",{"type":606,"tag":636,"props":4159,"children":4160},{"class":638,"line":774},[4161,4166,4170,4174,4179],{"type":606,"tag":636,"props":4162,"children":4163},{"style":651},[4164],{"type":612,"value":4165},"    raise",{"type":606,"tag":636,"props":4167,"children":4168},{"style":669},[4169],{"type":612,"value":4105},{"type":606,"tag":636,"props":4171,"children":4172},{"style":663},[4173],{"type":612,"value":666},{"type":606,"tag":636,"props":4175,"children":4176},{"style":763},[4177],{"type":612,"value":4178},"\"Cannot connect to database\"",{"type":606,"tag":636,"props":4180,"children":4181},{"style":663},[4182],{"type":612,"value":771},{"type":606,"tag":636,"props":4184,"children":4185},{"class":638,"line":99},[4186],{"type":606,"tag":636,"props":4187,"children":4188},{"emptyLinePlaceholder":13},[4189],{"type":612,"value":693},{"type":606,"tag":636,"props":4191,"children":4192},{"class":638,"line":108},[4193,4197,4202],{"type":606,"tag":636,"props":4194,"children":4195},{"style":651},[4196],{"type":612,"value":709},{"type":606,"tag":636,"props":4198,"children":4199},{"style":657},[4200],{"type":612,"value":4201}," get_user_data",{"type":606,"tag":636,"props":4203,"children":4204},{"style":663},[4205],{"type":612,"value":4206},"(user_id):\n",{"type":606,"tag":636,"props":4208,"children":4209},{"class":638,"line":117},[4210,4215],{"type":606,"tag":636,"props":4211,"children":4212},{"style":651},[4213],{"type":612,"value":4214},"    try",{"type":606,"tag":636,"props":4216,"children":4217},{"style":663},[4218],{"type":612,"value":747},{"type":606,"tag":636,"props":4220,"children":4221},{"class":638,"line":126},[4222],{"type":606,"tag":636,"props":4223,"children":4224},{"style":663},[4225],{"type":612,"value":4226},"        connect_to_database()\n",{"type":606,"tag":636,"props":4228,"children":4229},{"class":638,"line":135},[4230,4235,4239,4244,4249,4253,4257,4262],{"type":606,"tag":636,"props":4231,"children":4232},{"style":651},[4233],{"type":612,"value":4234},"        return",{"type":606,"tag":636,"props":4236,"children":4237},{"style":663},[4238],{"type":612,"value":1777},{"type":606,"tag":636,"props":4240,"children":4241},{"style":763},[4242],{"type":612,"value":4243},"\"id\"",{"type":606,"tag":636,"props":4245,"children":4246},{"style":663},[4247],{"type":612,"value":4248},": user_id, ",{"type":606,"tag":636,"props":4250,"children":4251},{"style":763},[4252],{"type":612,"value":3044},{"type":606,"tag":636,"props":4254,"children":4255},{"style":663},[4256],{"type":612,"value":1787},{"type":606,"tag":636,"props":4258,"children":4259},{"style":763},[4260],{"type":612,"value":4261},"\"User\"",{"type":606,"tag":636,"props":4263,"children":4264},{"style":663},[4265],{"type":612,"value":1833},{"type":606,"tag":636,"props":4267,"children":4268},{"class":638,"line":144},[4269,4274,4278],{"type":606,"tag":636,"props":4270,"children":4271},{"style":651},[4272],{"type":612,"value":4273},"    except",{"type":606,"tag":636,"props":4275,"children":4276},{"style":669},[4277],{"type":612,"value":4105},{"type":606,"tag":636,"props":4279,"children":4280},{"style":663},[4281],{"type":612,"value":747},{"type":606,"tag":636,"props":4283,"children":4284},{"class":638,"line":153},[4285,4289,4293,4298],{"type":606,"tag":636,"props":4286,"children":4287},{"style":669},[4288],{"type":612,"value":3982},{"type":606,"tag":636,"props":4290,"children":4291},{"style":663},[4292],{"type":612,"value":666},{"type":606,"tag":636,"props":4294,"children":4295},{"style":763},[4296],{"type":612,"value":4297},"\"Database connection failed, using cache\"",{"type":606,"tag":636,"props":4299,"children":4300},{"style":663},[4301],{"type":612,"value":771},{"type":606,"tag":636,"props":4303,"children":4304},{"class":638,"line":163},[4305,4309],{"type":606,"tag":636,"props":4306,"children":4307},{"style":651},[4308],{"type":612,"value":755},{"type":606,"tag":636,"props":4310,"children":4311},{"style":642},[4312],{"type":612,"value":4313},"  # Re-raise the exception\n",{"type":606,"tag":636,"props":4315,"children":4316},{"class":638,"line":172},[4317],{"type":606,"tag":636,"props":4318,"children":4319},{"emptyLinePlaceholder":13},[4320],{"type":612,"value":693},{"type":606,"tag":636,"props":4322,"children":4323},{"class":638,"line":181},[4324,4328],{"type":606,"tag":636,"props":4325,"children":4326},{"style":651},[4327],{"type":612,"value":845},{"type":606,"tag":636,"props":4329,"children":4330},{"style":663},[4331],{"type":612,"value":747},{"type":606,"tag":636,"props":4333,"children":4334},{"class":638,"line":190},[4335,4340,4344,4349,4354],{"type":606,"tag":636,"props":4336,"children":4337},{"style":663},[4338],{"type":612,"value":4339},"    user ",{"type":606,"tag":636,"props":4341,"children":4342},{"style":651},[4343],{"type":612,"value":862},{"type":606,"tag":636,"props":4345,"children":4346},{"style":663},[4347],{"type":612,"value":4348}," get_user_data(",{"type":606,"tag":636,"props":4350,"children":4351},{"style":669},[4352],{"type":612,"value":4353},"123",{"type":606,"tag":636,"props":4355,"children":4356},{"style":663},[4357],{"type":612,"value":771},{"type":606,"tag":636,"props":4359,"children":4360},{"class":638,"line":199},[4361,4365,4370,4374],{"type":606,"tag":636,"props":4362,"children":4363},{"style":651},[4364],{"type":612,"value":889},{"type":606,"tag":636,"props":4366,"children":4367},{"style":663},[4368],{"type":612,"value":4369}," DatabaseError ",{"type":606,"tag":636,"props":4371,"children":4372},{"style":651},[4373],{"type":612,"value":899},{"type":606,"tag":636,"props":4375,"children":4376},{"style":663},[4377],{"type":612,"value":904},{"type":606,"tag":636,"props":4379,"children":4380},{"class":638,"line":208},[4381,4385,4389,4393,4398,4402,4406,4410,4414],{"type":606,"tag":636,"props":4382,"children":4383},{"style":669},[4384],{"type":612,"value":912},{"type":606,"tag":636,"props":4386,"children":4387},{"style":663},[4388],{"type":612,"value":666},{"type":606,"tag":636,"props":4390,"children":4391},{"style":651},[4392],{"type":612,"value":921},{"type":606,"tag":636,"props":4394,"children":4395},{"style":763},[4396],{"type":612,"value":4397},"\"Database operation failed: ",{"type":606,"tag":636,"props":4399,"children":4400},{"style":669},[4401],{"type":612,"value":931},{"type":606,"tag":636,"props":4403,"children":4404},{"style":663},[4405],{"type":612,"value":936},{"type":606,"tag":636,"props":4407,"children":4408},{"style":669},[4409],{"type":612,"value":941},{"type":606,"tag":636,"props":4411,"children":4412},{"style":763},[4413],{"type":612,"value":946},{"type":606,"tag":636,"props":4415,"children":4416},{"style":663},[4417],{"type":612,"value":771},{"type":606,"tag":952,"props":4419,"children":4421},{"id":4420},"exception-organization-reference",[4422],{"type":612,"value":4423},"📊 Exception Organization Reference",{"type":606,"tag":1051,"props":4425,"children":4427},{"id":4426},"exception-naming-conventions",[4428],{"type":612,"value":4429},"Exception Naming Conventions",{"type":606,"tag":2661,"props":4431,"children":4432},{},[4433,4453],{"type":606,"tag":2665,"props":4434,"children":4435},{},[4436],{"type":606,"tag":2669,"props":4437,"children":4438},{},[4439,4444,4449],{"type":606,"tag":2673,"props":4440,"children":4441},{},[4442],{"type":612,"value":4443},"Type",{"type":606,"tag":2673,"props":4445,"children":4446},{},[4447],{"type":612,"value":4448},"Naming Pattern",{"type":606,"tag":2673,"props":4450,"children":4451},{},[4452],{"type":612,"value":2687},{"type":606,"tag":2689,"props":4454,"children":4455},{},[4456,4482,4508,4533],{"type":606,"tag":2669,"props":4457,"children":4458},{},[4459,4464,4473],{"type":606,"tag":2696,"props":4460,"children":4461},{},[4462],{"type":612,"value":4463},"General errors",{"type":606,"tag":2696,"props":4465,"children":4466},{},[4467],{"type":606,"tag":632,"props":4468,"children":4470},{"className":4469},[],[4471],{"type":612,"value":4472},"[Purpose]Error",{"type":606,"tag":2696,"props":4474,"children":4475},{},[4476],{"type":606,"tag":632,"props":4477,"children":4479},{"className":4478},[],[4480],{"type":612,"value":4481},"ValidationError",{"type":606,"tag":2669,"props":4483,"children":4484},{},[4485,4490,4499],{"type":606,"tag":2696,"props":4486,"children":4487},{},[4488],{"type":612,"value":4489},"Specific conditions",{"type":606,"tag":2696,"props":4491,"children":4492},{},[4493],{"type":606,"tag":632,"props":4494,"children":4496},{"className":4495},[],[4497],{"type":612,"value":4498},"[Condition]Error",{"type":606,"tag":2696,"props":4500,"children":4501},{},[4502],{"type":606,"tag":632,"props":4503,"children":4505},{"className":4504},[],[4506],{"type":612,"value":4507},"OutOfStockError",{"type":606,"tag":2669,"props":4509,"children":4510},{},[4511,4516,4525],{"type":606,"tag":2696,"props":4512,"children":4513},{},[4514],{"type":612,"value":4515},"API/Network",{"type":606,"tag":2696,"props":4517,"children":4518},{},[4519],{"type":606,"tag":632,"props":4520,"children":4522},{"className":4521},[],[4523],{"type":612,"value":4524},"[Service]Error",{"type":606,"tag":2696,"props":4526,"children":4527},{},[4528],{"type":606,"tag":632,"props":4529,"children":4531},{"className":4530},[],[4532],{"type":612,"value":2236},{"type":606,"tag":2669,"props":4534,"children":4535},{},[4536,4541,4550],{"type":606,"tag":2696,"props":4537,"children":4538},{},[4539],{"type":612,"value":4540},"Data processing",{"type":606,"tag":2696,"props":4542,"children":4543},{},[4544],{"type":606,"tag":632,"props":4545,"children":4547},{"className":4546},[],[4548],{"type":612,"value":4549},"[Data]Error",{"type":606,"tag":2696,"props":4551,"children":4552},{},[4553],{"type":606,"tag":632,"props":4554,"children":4556},{"className":4555},[],[4557],{"type":612,"value":4558},"ParseError",{"type":606,"tag":1051,"props":4560,"children":4562},{"id":4561},"exception-hierarchy-best-practices",[4563],{"type":612,"value":4564},"Exception Hierarchy Best Practices",{"type":606,"tag":2661,"props":4566,"children":4567},{},[4568,4587],{"type":606,"tag":2665,"props":4569,"children":4570},{},[4571],{"type":606,"tag":2669,"props":4572,"children":4573},{},[4574,4579,4583],{"type":606,"tag":2673,"props":4575,"children":4576},{},[4577],{"type":612,"value":4578},"Level",{"type":606,"tag":2673,"props":4580,"children":4581},{},[4582],{"type":612,"value":2682},{"type":606,"tag":2673,"props":4584,"children":4585},{},[4586],{"type":612,"value":2687},{"type":606,"tag":2689,"props":4588,"children":4589},{},[4590,4612,4634],{"type":606,"tag":2669,"props":4591,"children":4592},{},[4593,4598,4603],{"type":606,"tag":2696,"props":4594,"children":4595},{},[4596],{"type":612,"value":4597},"Base",{"type":606,"tag":2696,"props":4599,"children":4600},{},[4601],{"type":612,"value":4602},"Common error type",{"type":606,"tag":2696,"props":4604,"children":4605},{},[4606],{"type":606,"tag":632,"props":4607,"children":4609},{"className":4608},[],[4610],{"type":612,"value":4611},"class APIError(Exception)",{"type":606,"tag":2669,"props":4613,"children":4614},{},[4615,4620,4625],{"type":606,"tag":2696,"props":4616,"children":4617},{},[4618],{"type":612,"value":4619},"Category",{"type":606,"tag":2696,"props":4621,"children":4622},{},[4623],{"type":612,"value":4624},"Specific error group",{"type":606,"tag":2696,"props":4626,"children":4627},{},[4628],{"type":606,"tag":632,"props":4629,"children":4631},{"className":4630},[],[4632],{"type":612,"value":4633},"class AuthError(APIError)",{"type":606,"tag":2669,"props":4635,"children":4636},{},[4637,4642,4647],{"type":606,"tag":2696,"props":4638,"children":4639},{},[4640],{"type":612,"value":4641},"Specific",{"type":606,"tag":2696,"props":4643,"children":4644},{},[4645],{"type":612,"value":4646},"Exact error condition",{"type":606,"tag":2696,"props":4648,"children":4649},{},[4650],{"type":606,"tag":632,"props":4651,"children":4653},{"className":4652},[],[4654],{"type":612,"value":4655},"class InvalidTokenError(AuthError)",{"type":606,"tag":952,"props":4657,"children":4659},{"id":4658},"key-takeaways",[4660],{"type":612,"value":4661},"🎯 Key Takeaways",{"type":606,"tag":964,"props":4663,"children":4667},{"emoji":4664,"title":4665,"type":4666},"📚","Custom Exception Essentials","success",[4668,4676,4706,4714,4737,4745,4768],{"type":606,"tag":615,"props":4669,"children":4670},{},[4671],{"type":606,"tag":974,"props":4672,"children":4673},{},[4674],{"type":612,"value":4675},"Creating Custom Exceptions:",{"type":606,"tag":1026,"props":4677,"children":4678},{},[4679,4691,4696,4701],{"type":606,"tag":1030,"props":4680,"children":4681},{},[4682,4684,4689],{"type":612,"value":4683},"Inherit from ",{"type":606,"tag":632,"props":4685,"children":4687},{"className":4686},[],[4688],{"type":612,"value":672},{"type":612,"value":4690}," class",{"type":606,"tag":1030,"props":4692,"children":4693},{},[4694],{"type":612,"value":4695},"Use descriptive names ending in \"Error\"",{"type":606,"tag":1030,"props":4697,"children":4698},{},[4699],{"type":612,"value":4700},"Add custom attributes for extra data",{"type":606,"tag":1030,"props":4702,"children":4703},{},[4704],{"type":612,"value":4705},"Provide helpful error messages",{"type":606,"tag":615,"props":4707,"children":4708},{},[4709],{"type":606,"tag":974,"props":4710,"children":4711},{},[4712],{"type":612,"value":4713},"Organization:",{"type":606,"tag":1026,"props":4715,"children":4716},{},[4717,4722,4727,4732],{"type":606,"tag":1030,"props":4718,"children":4719},{},[4720],{"type":612,"value":4721},"Create exception hierarchies",{"type":606,"tag":1030,"props":4723,"children":4724},{},[4725],{"type":612,"value":4726},"Group related exceptions together",{"type":606,"tag":1030,"props":4728,"children":4729},{},[4730],{"type":612,"value":4731},"Use base exceptions for common handling",{"type":606,"tag":1030,"props":4733,"children":4734},{},[4735],{"type":612,"value":4736},"Include error codes for classification",{"type":606,"tag":615,"props":4738,"children":4739},{},[4740],{"type":606,"tag":974,"props":4741,"children":4742},{},[4743],{"type":612,"value":4744},"Best Practices:",{"type":606,"tag":1026,"props":4746,"children":4747},{},[4748,4753,4758,4763],{"type":606,"tag":1030,"props":4749,"children":4750},{},[4751],{"type":612,"value":4752},"Make exceptions specific to your domain",{"type":606,"tag":1030,"props":4754,"children":4755},{},[4756],{"type":612,"value":4757},"Include relevant context information",{"type":606,"tag":1030,"props":4759,"children":4760},{},[4761],{"type":612,"value":4762},"Use consistent naming conventions",{"type":606,"tag":1030,"props":4764,"children":4765},{},[4766],{"type":612,"value":4767},"Document exception conditions",{"type":606,"tag":615,"props":4769,"children":4770},{},[4771,4776],{"type":606,"tag":974,"props":4772,"children":4773},{},[4774],{"type":612,"value":4775},"Remember:",{"type":612,"value":4777}," Custom exceptions make your code more maintainable and errors more understandable!",{"type":606,"tag":952,"props":4779,"children":4781},{"id":4780},"whats-next",[4782],{"type":612,"value":4783},"🚀 What's Next?",{"type":606,"tag":615,"props":4785,"children":4786},{},[4787],{"type":612,"value":4788},"Learn debugging techniques to find and fix issues in your code effectively.",{"type":606,"tag":615,"props":4790,"children":4791},{},[4792,4797,4798],{"type":606,"tag":974,"props":4793,"children":4794},{},[4795],{"type":612,"value":4796},"Continue to",{"type":612,"value":1787},{"type":606,"tag":4799,"props":4800,"children":4801},"a",{"href":381},[4802],{"type":612,"value":382},{"type":606,"tag":4804,"props":4805,"children":4806},"style",{},[4807],{"type":612,"value":4808},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}html.app-dark-mode .shiki span {color: var(--shiki-app-dark-mode);background: var(--shiki-app-dark-mode-bg);font-style: var(--shiki-app-dark-mode-font-style);font-weight: var(--shiki-app-dark-mode-font-weight);text-decoration: var(--shiki-app-dark-mode-text-decoration);}",{"title":8,"searchDepth":36,"depth":36,"links":4810},[4811,4816,4817,4822,4826,4827],{"id":954,"depth":27,"text":957,"children":4812},[4813,4814,4815],{"id":1053,"depth":36,"text":1056},{"id":1541,"depth":36,"text":1544},{"id":2148,"depth":36,"text":2151},{"id":2656,"depth":27,"text":2659},{"id":2783,"depth":27,"text":2786,"children":4818},[4819,4820,4821],{"id":2789,"depth":36,"text":2792},{"id":3385,"depth":36,"text":3388},{"id":4042,"depth":36,"text":4045},{"id":4420,"depth":27,"text":4423,"children":4823},[4824,4825],{"id":4426,"depth":36,"text":4429},{"id":4561,"depth":36,"text":4564},{"id":4658,"depth":27,"text":4661},{"id":4780,"depth":27,"text":4783},1782373759653]