For showing Custom Error Pages on Publish, say for a 404, you can follow product documentation and create the page in /apps/sling/servlet/errorhandler. However if you want to give some flexibility to the authoring team for some creative error pages, basically Authorable Error Pages, they can be created as normal pages and published. With some Dispatcher Configuration they can be served as Error Pages
1) Create a sample project to test the Dispatcher Error Directives..
mvn -B org.apache.maven.plugins:maven-archetype-plugin:3.2.1:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=36 -D aemVersion="cloud" -D appTitle="Experience AEM Dispatcher Error Directives" -D appId="eaem-dispatcher-error-directives" -D groupId="apps.experienceaem.sites" -D frontendModule=none -D includeExamples=n -D includeDispatcherConfig=y
2) Create a regular page in AEM (may be in a specialized structure like /content/eaem-dispatcher-error-directives/us/en/tools) for showing errors like 404 Not Found, publish them..
3) Copy eaem-dispatcher-error-directives\dispatcher\src\conf.d\available_vhosts\default.vhost and create eaem-dispatcher-error-directives\dispatcher\src\conf.d\available_vhosts\eaem.vhost