Cara menggunakan python custom exceptions

Isi Dokumentasi Python

  • Apa yang Baru di Python
    • What's New In Python 3.10
    • What's New In Python 3.9
    • What's New In Python 3.8
    • What's New In Python 3.7
    • Apa yang Baru di Python 3.6
    • What's New In Python 3.5
    • What's New In Python 3.4
    • What's New In Python 3.3
    • What's New In Python 3.2
    • What's New In Python 3.1
    • Apa yang Baru Di Python 3.0
    • Apa yang Baru di Python 2.7
    • Apa yang Baru di Python 2.6
    • What's New in Python 2.5
    • What's New in Python 2.4
    • What's New in Python 2.3
    • What's New in Python 2.2
    • Apa yang Baru di Python 2.1
    • What's New in Python 2.0
    • Catatan Perubahan
  • Tutorial Python
    • 1. Membangkitkan Selera Anda
    • 2. Menggunakan Interpreter Python
    • 3. Pengantar Informal Tentang Python
    • 4. Lebih Banyak Alat Pengatur Aliran Control Flow
    • 5. Struktur Data
    • 6. Modul-Modul
    • 7. Masukan dan Keluaran
    • 8. Kesalahan errors dan Pengecualian exceptions
    • 9. Classes
    • 10. Tur Singkat Pustaka Standar
    • 11. Tur Singkat Pustaka Standar --- Bagian II
    • 12. Lingkungan dan Paket Virtual
    • 13. Lalu apa sekarang?
    • 14. Pengeditan Input Interaktif dan Penggantian Riwayat
    • 15. Aritmatika Pecahan Floating Point: Masalah dan Keterbatasan
    • 16. Lampiran
  • Pengaturan dan Penggunaan Python
    • 1. Baris perintah dan lingkungan
    • 2. Using Python on Unix platforms
    • 3. Configure Python
    • 4. Menggunakan Python di Windows
    • 5. Using Python on a Mac
    • 6. Editor dan IDE
  • Referensi Bahasa Python
    • 1. Pengenalan
    • 2. Lexical analysis
    • 3. Data model
    • 4. Execution model
    • 5. The import system
    • 6. Expressions
    • 7. Simple statements
    • 8. Pernyataan gabungan
    • 9. Komponen tingkat atas
    • 10. Spesifikasi Lengkap Tata Bahasa
  • Pustaka Standar Python
    • Pengenalan
    • Fungsi Bawaan
    • Konstanta Bawaan
    • Tipe Bawaan
    • Built-in Exceptions
    • Layanan Pemrosesan Teks
      • make touch4 --- Operasi umum pada string.
      • make touch5 --- Regular expression operations
      • make touch6 --- Helpers for computing deltas
      • make touch7 --- Text wrapping and filling
      • make touch8 --- Unicode Database
      • make touch9 --- Internet String Preparation
      • make regen-all0 --- GNU readline interface
      • make regen-all1 --- Completion function for GNU readline
    • Servis Data Binary
      • make regen-all2 --- Interpret bytes as packed binary data
      • make regen-all3 --- Codec registry and base classes
    • Tipe Data
      • make regen-all7 --- Basic date and time types
      • encoding="locale"02 --- IANA time zone support
      • encoding="locale"05 --- Fungsi-fungsi umum yang terkait dengan modul calendar
      • encoding="locale"06 --- Container datatypes
      • encoding="locale"20 --- Abstract Base Classes for Containers
      • encoding="locale"21 --- Heap queue algorithm
      • encoding="locale"22 --- Array bisection algorithm
      • encoding="locale"23 --- Efficient arrays of numeric values
      • encoding="locale"24 --- Weak references
      • encoding="locale"26 --- Dynamic type creation and names for built-in types
      • encoding="locale"27 --- Operasi shallow copy dan deep copy
      • encoding="locale"28 --- Data pretty printer
      • encoding="locale"29 --- Alternate encoding="locale"30 implementation
      • encoding="locale"31 --- Support for enumerations
      • encoding="locale"43 --- Functionality to operate with graph-like structures
    • Modul Numerik dan Matematika
      • encoding="locale"44 --- Numeric abstract base classes
      • encoding="locale"45 --- Mathematical functions
      • encoding="locale"46 --- Mathematical functions for complex numbers
      • encoding="locale"47 --- Decimal fixed point and floating point arithmetic
      • encoding="locale"6 --- Rational numbers
      • encoding="locale"49 --- Generate pseudo-random numbers
      • encoding="locale"50 --- Mathematical statistics functions
    • Modul Pemrograman Fungsional
      • encoding="locale"53 --- Functions creating iterators for efficient looping
      • encoding="locale"54 --- Higher-order functions and operations on callable objects
      • encoding="locale"56 --- Standard operators as functions
    • File and Directory Access
      • encoding="locale"57 --- Object-oriented filesystem paths
      • encoding="locale"59 --- Common pathname manipulations
      • encoding="locale"60 --- Iterate over lines from multiple input streams
      • encoding="locale"61 --- Interpreting encoding="locale"62 results
      • encoding="locale"63 --- File and Directory Comparisons
      • encoding="locale"65 --- Generate temporary files and directories
      • encoding="locale"66 --- Ekspansi pola nama jalur bergaya Unix
      • encoding="locale"67 --- Unix filename pattern matching
      • encoding="locale"68 --- Random access to text lines
      • encoding="locale"69 --- High-level file operations
    • Persistensi Data
      • encoding="locale"70 --- Python object serialization
      • encoding="locale"73 --- Register encoding="locale"70 support functions
      • encoding="locale"75 --- Python object persistence
      • encoding="locale"71 --- Internal Python object serialization
      • encoding="locale"77 --- Interfaces to Unix "databases"
      • encoding="locale"81 --- DB-API 2.0 antarmuka untuk basisdata SQLite
    • Kompresi Data dan Pengarsipan
      • encoding="locale"82 --- Compression compatible with gzip
      • encoding="locale"83 --- Support for gzip files
      • encoding="locale"84 --- Support for bzip2 compression
      • encoding="locale"85 --- Compression using the LZMA algorithm
      • encoding="locale"86 --- Work with ZIP archives
      • encoding="locale"87 --- Read and write tar archive files
    • File Formats
      • encoding="locale"88 --- Baca dan Tulis file CSV
      • encoding="locale"89 --- Configuration file parser
      • encoding="locale"90 --- netrc file processing
      • =0 --- Generate and parse Apple encoding="locale"92 files
    • Layanan Kriptografi
      • encoding="locale"93 --- Secure hashes and message digests
      • encoding="locale"94 --- Keyed-Hashing for Message Authentication
      • encoding="locale"95 --- Generate secure random numbers for managing secrets
    • Layanan Sistem Operasi Generik
      • encoding="locale"58 --- Miscellaneous operating system interfaces
      • encoding="locale"97 --- Core tools for working with streams
      • make touch4 --- Akses waktu dan konversi
      • encoding="locale"99 --- Parser for command-line options, arguments and sub-commands
      • =02 --- C-style parser for command line options
      • =03 --- Logging facility for Python
      • =04 --- Logging configuration
      • =05 --- Logging handlers
      • =06 --- Portable password input
      • =07 --- Terminal handling for character-cell displays
      • =09 --- Utilities for ASCII characters
      • =10 --- A panel stack extension for curses
      • =11 --- Access to underlying platform's identifying data
      • =12 --- Standard errno system symbols
      • =13 --- A foreign function library for Python
    • Eksekusi Serentak
      • =14 --- Thread-based parallelism
      • encoding="locale"4 --- Process-based parallelism
      • =23 --- Shared memory for direct access across processes
      • Paket =24
      • encoding="locale"0 --- Launching parallel tasks
      • =26 --- Subprocess management
      • =35 --- Event scheduler
      • =36 --- A synchronized queue class
      • =37 --- Context Variables
      • =38 --- Low-level threading API
    • Komunikasi Interproses dan Networking
      • =39 --- Asynchronous I/O
        • Coroutines and Tasks
        • Streams
        • Synchronization Primitives
        • Subprocesses
        • Queues
        • Pengecualian
        • Event Loop
        • Futures
        • Transports and Protocols
        • Policies
        • Platform Support
        • Indeks API Tingkat-atas
        • Low-level API Index
        • Developing with asyncio
      • =40 --- Low-level networking interface
      • =43 --- TLS/SSL wrapper for socket objects
      • =44 --- Waiting for I/O completion
      • =46 --- High-level I/O multiplexing
      • =47 --- Set handlers for asynchronous events
      • =48 --- Memory-mapped file support
    • Penanganan Data Internet
      • =49 --- Paket penanganan email dan MIME
        • =50: Representing an email message
        • =51: Parsing email messages
        • =52: Generating MIME documents
        • =53: Policy Objects
        • =54: Exception and Defect classes
        • =55: Custom Header Objects
        • =56: Managing MIME Content
        • =49: Examples
        • =58: Representing an email message using the =59 API
        • =60: Creating email and MIME objects from scratch
        • =61: Internationalized headers
        • =62: Representing character sets
        • =63: Encoders
        • =64: Miscellaneous utilities
        • =65: Iterators
      • encoding="locale"9 --- JSON encoder dan decoder
      • =67 --- Manipulate mailboxes in various formats
      • =80 --- Map filenames to MIME types
      • =81 --- Base16, Base32, Base64, Base85 Data Encodings
      • =82 --- Encode and decode binhex4 files
      • =83 --- Convert between binary and ASCII
      • =84 --- Encode and decode MIME quoted-printable data
    • Alat Pemroses Markup Terstruktur
      • =85 --- Dukungan HyperText Markup Language
      • =86 --- Simple HTML and XHTML parser
      • =88 --- Definisi entitas umum HTML
      • XML Processing Modules
      • =90 --- The ElementTree XML API
      • =91 --- The Document Object Model API
      • =92 --- Minimal DOM implementation
      • =93 --- Support for building partial DOM trees
      • =94 --- Support for SAX2 parsers
      • =95 --- Base classes for SAX handlers
      • =96 --- SAX Utilities
      • =97 --- Interface for XML parsers
      • breakpoint[]00 --- Fast XML parsing using Expat
    • Protokol Internet dan Dukungan
      • breakpoint[]01 --- Convenient web-browser controller
      • breakpoint[]02 --- WSGI Utilities and Reference Implementation
      • breakpoint[]08 --- Modul penanganan URL
      • breakpoint[]09 --- Extensible library for opening URLs
      • breakpoint[]12 --- Parse URLs into components
      • breakpoint[]13 --- Exception classes raised by urllib.request
      • breakpoint[]14 --- Parser for robots.txt
      • breakpoint[]15 --- modul HTTP
      • breakpoint[]16 --- HTTP protocol client
      • breakpoint[]17 --- FTP protocol client
      • breakpoint[]18 --- POP3 protocol client
      • breakpoint[]19 --- IMAP4 protocol client
      • breakpoint[]20 --- SMTP protocol client
      • breakpoint[]21 --- UUID objects according to RFC 4122
      • breakpoint[]22 --- A framework for network servers
      • breakpoint[]25 --- HTTP servers
      • breakpoint[]26 --- HTTP state management
      • breakpoint[]27 --- Cookie handling for HTTP clients
      • breakpoint[]28 --- XMLRPC server and client modules
      • breakpoint[]29 --- akses klien XML-RPC
      • breakpoint[]30 --- Basic XML-RPC servers
      • breakpoint[]31 --- IPv4/IPv6 manipulation library
    • Layanan Multimedia
      • breakpoint[]32 --- Read and write WAV files
      • breakpoint[]33 --- Conversions between color systems
    • Internasionalisasi
      • breakpoint[]34 --- Multilingual internationalization services
      • breakpoint[]37 --- Internationalization services
    • Kerangka Program
      • breakpoint[]38 --- Turtle graphics
      • breakpoint[]40 --- Support for line-oriented command interpreters
      • breakpoint[]41 --- Simple lexical analysis
    • User Interfaces Grafis dengan Tk
      • breakpoint[]42 --- Python interface to Tcl/Tk
      • breakpoint[]43 --- Color choosing dialog
      • breakpoint[]44 --- Tkinter font wrapper
      • Tkinter Dialogs
      • breakpoint[]48 --- Tkinter message prompts
      • breakpoint[]49 --- Scrolled Text Widget
      • breakpoint[]50 --- Drag and drop support
      • breakpoint[]51 --- Tk themed widgets
      • breakpoint[]52 --- Extension widgets for Tk
      • IDLE
    • Alat Pengembangan
      • typing --- Support for type hints
      • breakpoint[]58 --- Documentation generator and online help system
      • Python Development Mode
      • breakpoint[]59 --- Contoh uji interaktif Python
      • breakpoint[]60 --- Unit testing framework
      • breakpoint[]61 --- mock object library
      • breakpoint[]61 --- getting started
      • 2to3 --- Automated Python 2 to 3 code translation
      • breakpoint[]64 --- Regression tests package for Python
    • Debugging dan Profiling
      • Audit events table
      • breakpoint[]74 --- Debugger framework
      • breakpoint[]75 --- Dump the Python traceback
      • breakpoint[]76 --- The Python Debugger
      • The Python Profilers
      • breakpoint[]80 --- Measure execution time of small code snippets
      • breakpoint[]81 --- Trace or track Python statement execution
      • breakpoint[]82 --- Trace memory allocations
    • Pengemasan dan Distribusi Perangkat Lunak
      • breakpoint[]83 --- Building and installing Python modules
      • breakpoint[]84 --- Bootstrapping the breakpoint[]85 installer
      • breakpoint[]86 --- Creation of virtual environments
      • breakpoint[]88 --- Manage executable Python zip archives
    • Layanan Runtime Python
      • breakpoint[]89 --- System-specific parameters and functions
      • breakpoint[]90 --- Provide access to Python's configuration information
      • breakpoint[]92 --- Objek-objek bawaan
      • __main__ --- Top-level code environment
      • breakpoint[]97 --- Warning control
      • breakpoint[]98 --- Data Classes
      • __main__00 --- Utilities for typing0-statement contexts
      • __main__05 --- Abstract Base Classes
      • __main__06 --- Exit handlers
      • __main__08 --- Print or retrieve a stack traceback
      • __main__12 --- Future statement definitions
      • __main__13 --- Garbage Collector interface
      • __main__14 --- Inspect live objects
      • typing4 --- Site-specific configuration hook
    • Ubahsuaian Interpreter Python
      • __main__16 --- Interpreter base classes
      • __main__17 --- Compile Python code
    • Mengimpor Modul
      • __main__18 --- Import modules from Zip archives
      • __main__19 --- Package extension utility
      • __main__20 --- Find modules used by a script
      • __main__22 --- Locating and executing Python modules
      • breakpoint[]4 --- The implementation of __main__3
      • Using __main__30
    • Layanan Bahasa Python
      • encoding="locale"7 --- Abstract Syntax Trees
      • __main__33 --- Access to the compiler's symbol tables
      • __main__34 --- Konstanta digunakan dengan pohon pengurai [parse tree] Python
      • __main__35 --- Pengujian untuk kata kunci Python
      • __main__36 --- Tokenizer for Python source
      • mod:tabnanny --- Deteksi indentasi ambigu
      • __main__37 --- Python module browser support
      • __main__38 --- Compile Python source files
      • __main__39 --- Byte-compile Python libraries
      • __main__40 --- Disassembler for Python bytecode
      • __main__41 --- Tools for pickle developers
    • Layanan MS Windows Spesifik
      • __main__42 --- Useful routines from the MS VC++ runtime
      • __main__43 --- Windows registry access
      • __main__44 --- Sound-playing interface for Windows
    • Layanan Khusus Unix
      • __main__45 --- The most common POSIX system calls
      • __main__46 --- The password database
      • __main__47 --- The group database
      • __main__48 --- POSIX style tty control
      • __main__49 --- Terminal control functions
      • __main__50 --- Pseudo-terminal utilities
      • __main__51 --- The __main__51 and __main__53 system calls
      • __main__54 --- Resource usage information
      • __main__55 --- Unix syslog library routines
    • Modul yang Diganti
      • __main__56 --- Read and write AIFF and AIFC files
      • __main__57 --- Asynchronous socket command/response handler
      • __main__58 --- Asynchronous socket handler
      • __main__59 --- Manipulate raw audio data
      • __main__60 --- Common Gateway Interface support
      • __main__61 --- Traceback manager for CGI scripts
      • __main__62 --- Read IFF chunked data
      • __main__63 --- Function to check Unix passwords
      • __main__64 --- Determine the type of an image
      • __main__65 --- Access the import internals
      • __main__66 --- Mailcap file handling
      • __main__67 --- Read and write Microsoft Installer files
      • __main__68 --- Interface to Sun's NIS [Yellow Pages]
      • __main__69 --- NNTP protocol client
      • __main__70 --- Parser for command line options
      • __main__73 --- Access to OSS-compatible audio devices
      • __main__74 --- Interface to shell pipelines
      • __main__75 --- SMTP Server
      • __main__76 --- Determine type of sound file
      • __main__77 --- The shadow password database
      • __main__78 --- Read and write Sun AU files
      • __main__79 --- Telnet client
      • __main__80 --- Encode and decode uuencode files
      • __main__81 --- Encode and decode XDR data
    • Security Considerations
  • Memperluas dan Menggabungkan Interpreter Python
      • 1. Extending Python with C or C++
      • 2. Mendefinisikan Tipe Ekstensi: Tutorial
      • 3. Defining Extension Types: Assorted Topics
      • 4. Building C and C++ Extensions
      • 5. Building C and C++ Extensions on Windows
      • 1. Embedding Python in Another Application
  • Panduan Referensi Python/API C
    • Pengenalan
    • C API Stability
    • The Very High Level Layer
    • Reference Counting
    • Penanganan Pengecualian
    • Utilitas
      • Operating System Utilities
      • Mengimpor Modul
      • Data marshalling support
      • Mengurai argumen dan membangun nilai
      • Pemformatan dan konversi string
      • Reflection
      • Codec registry and support functions
    • Lapisan Abstrak Objek
      • Object Protocol
      • Call Protocol
      • Number Protocol
      • Sequence Protocol
      • Protokol Pemetaan
      • Iterator Protocol
      • Protokol Penampung Buffer
      • Old Buffer Protocol
    • Lapisan Objek Konkrit
        • Objek Tipe
        • Objek __main__82
        • Integer Objects
        • Objek Boolean
        • Objek Pecahan
        • Objek Bilangan Kompleks
        • Bytes Objects
        • Objek Byte Array
        • Unicode Objects and Codecs
        • Tuple Objects
        • List Objects
        • Objek Dictionary
        • Set Objects
        • Objek Fungsi
        • Instance Method Objects
        • Objek Sel, Cell
        • Objek Kode
        • Objek File
        • Module Objects
        • Objek Iterator
        • Obyek Deskriptor
        • Slice Objects
        • MemoryView objects
        • Weak Reference Objects
        • Kapsul
        • Generator Objects
        • Objek Coroutine
        • Context Variables Objects
        • Objek DateTime
        • Objects for Type Hinting
    • Initialization, Finalization, and Threads
    • Python Initialization Configuration
    • Memory Management
    • Dukungan Implementasi Objek
      • Mengalokasikan objek kedalam struktur data [heap]
      • Struktur Objek Umum
      • Objek Tipe
      • Supporting Cyclic Garbage Collection
    • Pengelolaan Versi API dan ABI
  • Mendistribusikan Modul Python
  • Memasang Modul-modul Python
  • HOWTOs Python
    • Penyesuaian Porting Kode Python 2 ke Python 3
    • Penyesuaian Porting Modul Ekstensi ke Python 3
    • Pemrograman Curses dengan Python
    • Descriptor HowTo Guide
    • Pemrograman Fungsional HOWTO
    • Logging HOWTO
    • Logging Cookbook
    • Regular Expression HOWTO
    • HOWTO Pemrograman Soket
    • Sorting HOW TO
    • Unicode HOWTO
    • HOWTO Fetch Internet Resources Using The urllib Package
    • Argparse Tutorial
    • An introduction to the ipaddress module
    • Klinik Argumen How-To
    • Instrumenting CPython with DTrace and SystemTap
    • Annotations Best Practices
  • Pertanyaan tentang Python yang Sering Diajukan
    • FAQ Umum Python
    • Pemrograman FAQ
    • Desain dan Sejarah FAQ
    • FAQ Pustaka dan Ekstensi
    • Extending/Embedding FAQ
    • FAQ Python di Windows
    • Antarmuka Pengguna Grafis FAQ
    • "Kenapa Python Terpasang di Komputer saya?" FAQ
  • Ikhtisar
  • Tentang dokumen-dokumen ini
  • Berurusan dengan Bugs
  • Hak Cipta
  • Sejarah dan Lisensi

Apa itu custom exception handling pada python?

Python Exception handling adalah suatu mekanisme penanganan flow normal program karena terjadi exception dengan melanjutkan flow ke code block lainnya. Kenapa harus menangani exception? Karena terjadi exception dan kita tidak tangani, maka program akan berhenti.

Apa itu Exception pada python?

Exception adalah objek Python yang mewakili kesalahan.

Apa penyebab terjadinya suatu pengecualian exceptions di suatu program?

Exception dipicu oleh runtime error, yaitu error atau kesalahan yang terjadi saat program dieksekusi oleh interpreter.

Apa itu try dan except di Python?

Try digunakan untuk menguji suatu instruksi. Except untuk menampilkan pesan kesalahan.

Bài mới nhất

Chủ Đề