{"id":2634,"date":"2025-11-11T11:31:50","date_gmt":"2025-11-11T04:31:50","guid":{"rendered":"https:\/\/portal-atlasx.cdg.co.th\/home\/?post_type=docs&#038;p=2634"},"modified":"2025-11-11T15:17:11","modified_gmt":"2025-11-11T08:17:11","slug":"error","status":"publish","type":"docs","link":"https:\/\/portal-atlasx.cdg.co.th\/home\/docs\/android\/library\/error\/","title":{"rendered":"Error"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\" id=\"errorcontroller\" style=\"font-style:normal;font-weight:600\">ErrorController<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"variables\"><strong>Variables<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><th>Variable Type<\/th><\/tr><\/thead><tbody><tr><td>DEFAULT_CODE<\/td><td>\u0e40\u0e25\u0e02 code \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e23\u0e30\u0e1a\u0e38 error<\/td><td>Int<\/td><td>400<\/td><td>const val<\/td><\/tr><tr><td>CODE<\/td><td>\u0e40\u0e25\u0e02 code \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e23\u0e30\u0e1a\u0e38 error \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e14\u0e49 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e40\u0e1b\u0e25\u0e35\u0e48\u0e22\u0e19\u0e04\u0e48\u0e32 code<\/td><td>Int<\/td><td>DEFAULT_CODE<\/td><td>var<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-overview\"><strong>Method Overview<\/strong><\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Return<\/th><\/tr><\/thead><tbody><tr><td>showErrorLog()<\/td><td>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07 Log message \u0e43\u0e19 console \u0e42\u0e14\u0e22\u0e08\u0e30\u0e21\u0e35 format \u0e15\u0e32\u0e21 Error String \u0e17\u0e35\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e02\u0e2d\u0e07 AtlasX<\/td><td>Int<\/td><\/tr><tr><td>getErrorString()<\/td><td>String \u0e17\u0e35\u0e48\u0e40\u0e1b\u0e47\u0e19 format error \u0e02\u0e2d\u0e07 AtlasX<\/td><td>String<\/td><\/tr><tr><td>showErrorInAlert()<\/td><td>\u0e41\u0e2a\u0e14\u0e07 AlertDialog \u0e17\u0e35\u0e48\u0e21\u0e35 format \u0e02\u0e2d\u0e07\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e1b\u0e47\u0e19\u0e41\u0e1a\u0e1a AltlasX<\/td><td>Unit<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"method-details\"><strong>Method Details<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun showErrorLog(message: String , code: Int = CODE) : Int<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">showErrorLog<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">message<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">code<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Int<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0070C1\">CODE<\/span><span style=\"color: #000000\">) : <\/span><span style=\"color: #001080\">Int<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07 Log message \u0e43\u0e19 console \u0e42\u0e14\u0e22\u0e08\u0e30\u0e21\u0e35 format \u0e15\u0e32\u0e21 Error String \u0e17\u0e35\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e02\u0e2d\u0e07 AtlasX<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><\/tr><\/thead><tbody><tr><td>message<\/td><td>\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e43\u0e19 Log<\/td><td>String<\/td><td><\/td><\/tr><tr><td>code<\/td><td>\u0e40\u0e25\u0e02 code \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07<\/td><td>Int<\/td><td>CODE<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>Int<\/td><td>Return Log value<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun getErrorString(message: String , code: Int = CODE) : String<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">getErrorString<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">message<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">code<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Int<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0070C1\">CODE<\/span><span style=\"color: #000000\">) : <\/span><span style=\"color: #001080\">String<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07 message String \u0e42\u0e14\u0e22\u0e08\u0e30\u0e21\u0e35 format \u0e15\u0e32\u0e21 Error String \u0e17\u0e35\u0e48\u0e01\u0e33\u0e2b\u0e19\u0e14\u0e02\u0e2d\u0e07 AtlasX \u0e04\u0e37\u0e2d &#8220;AtlasX Code: {\u0e40\u0e25\u0e02 code \u0e02\u0e2d\u0e07\u0e40\u0e23\u0e32} : {\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07}&#8221; \u0e40\u0e0a\u0e48\u0e19 getErrorString(&#8220;Number Format Error&#8221;) \u0e08\u0e30\u0e44\u0e14\u0e49 String error \u0e2d\u0e2d\u0e01\u0e21\u0e32\u0e04\u0e37\u0e2d\u0e41 AtlasX Code: 400 : Number Format Error<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-1\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><\/tr><\/thead><tbody><tr><td>message<\/td><td>\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07<\/td><td>String<\/td><td><\/td><\/tr><tr><td>code<\/td><td>\u0e40\u0e25\u0e02 code \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07<\/td><td>Int<\/td><td>CODE<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"returns-1\"><strong>Returns<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Type<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td>String<\/td><td>Return String \u0e17\u0e35\u0e48\u0e1a\u0e2d\u0e01 error \u0e15\u0e32\u0e21 format \u0e02\u0e2d\u0e07 AtlasX<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span role=\"button\" tabindex=\"0\" style=\"color:#000000;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>fun showErrorInAlert(context: Context , message: String , code : Int = CODE)<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M4.5 12.75l6 6 9-13.5\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 8.25V6a2.25 2.25 0 00-2.25-2.25H6A2.25 2.25 0 003.75 6v8.25A2.25 2.25 0 006 16.5h2.25m8.25-8.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-7.5A2.25 2.25 0 018.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 00-2.25 2.25v6\"><\/path><\/svg><\/span><pre class=\"shiki light-plus\" style=\"background-color: #FFFFFF\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #001080\">fun<\/span><span style=\"color: #000000\"> <\/span><span style=\"color: #795E26\">showErrorInAlert<\/span><span style=\"color: #000000\">(<\/span><span style=\"color: #001080\">context<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">Context<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">message<\/span><span style=\"color: #000000\">: <\/span><span style=\"color: #001080\">String<\/span><span style=\"color: #000000\"> , <\/span><span style=\"color: #001080\">code<\/span><span style=\"color: #000000\"> : <\/span><span style=\"color: #001080\">Int<\/span><span style=\"color: #000000\"> = <\/span><span style=\"color: #0070C1\">CODE<\/span><span style=\"color: #000000\">)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>\u0e41\u0e2a\u0e14\u0e07 AlertDialog \u0e17\u0e35\u0e48\u0e21\u0e35 format \u0e02\u0e2d\u0e07\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e1b\u0e47\u0e19\u0e41\u0e1a\u0e1a AltlasX<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"parameters-2\"><strong>Parameters<\/strong><\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table style=\"border-width:1px\"><thead><tr><th>Name<\/th><th>Description<\/th><th>Type<\/th><th>Default<\/th><\/tr><\/thead><tbody><tr><td>context<\/td><td>context \u0e02\u0e2d\u0e07 fragment \u0e2b\u0e23\u0e37\u0e2d activity \u0e17\u0e35\u0e48\u0e08\u0e30\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19<\/td><td>Context<\/td><td><\/td><\/tr><tr><td>message<\/td><td>\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07<\/td><td>String<\/td><td><\/td><\/tr><tr><td>code<\/td><td>\u0e40\u0e25\u0e02 code \u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07<\/td><td>Int<\/td><td>CODE<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"featured_media":0,"parent":2531,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"nav_title":"","positive":"","negative":"","footnotes":""},"docs_category":[],"class_list":["post-2634","docs","type-docs","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/comments?post=2634"}],"version-history":[{"count":1,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2634\/revisions"}],"predecessor-version":[{"id":2649,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2634\/revisions\/2649"}],"up":[{"embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs\/2531"}],"wp:attachment":[{"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/media?parent=2634"}],"wp:term":[{"taxonomy":"docs_category","embeddable":true,"href":"https:\/\/portal-atlasx.cdg.co.th\/home\/wp-json\/wp\/v2\/docs_category?post=2634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}