Pallet errors are thrown out when things go wrong in the runtime, those are defined in the metadata. Available errors for each pallet are also exposed in ChainApi interface, so we can get information an error through this syntax: client.errors.<pallet>.<errorName>. E.g: Available errors for Polkadot network can be found here.
Similar to Event API, this API is helpful when we want to check if an error maches with an error that we're expecting.
Example to check if an error is AlreadyExists from Assets pallet: