#errorfication
Explore tagged Tumblr posts
jay-justjay · 10 months ago
Text
Tumblr media Tumblr media
More Krash art
They’re slowly becoming a trash panda the more I concept them ✨
That cup has no liquid in it, they’re just chewing on the straw
Killer by Rahafwabas
Krash by me
78 notes · View notes
aguinhac · 3 months ago
Text
while i was looking for aus birthdays so I could put them in my calender and draw em, I ended up in @loverofpiggies profile lookin for error's b-day, so i thought might as well get blueberror's bday, but turns out he got none, not one b-day, not one idk, errorfication day, nothing. and that is a CRIME, i will not allow my boy to be this mistreaten, so i am turning today, 03/22 blueberror's day, as such i did a redraw.
Tumblr media
another one who would work perfectly would be 04/02, but theres already too much holidays in april.
61 notes · View notes
iammeiamwe · 11 months ago
Note
Heya! I saw that you took art requests from the fandoms you are in and I wanted to know if you could draw my character Prime!Error(The left half of his face is just a blank white that was a result of him trying to fix his Errorfication)
Tumblr media Tumblr media
Hello there 👋
Tumblr media
Here you go! I actually had quite a bit of fun drawing Prime!Error, so I hope you like it!
Also, good luck with developing The True Alphaverse! It seems like a very complex but at the same time intriguing project!🩷
9 notes · View notes
a-v-j · 2 years ago
Note
"Okay, so let us continue. While Extinction at a young age might be lacking empathy, he might not found Killer's situation weird. But what about when he grows up, since when he grows up Extinction gains empathy or understands it at least, he might question it or understand the other meaning of it."
"Since I thought about it more, I am asking this again just to be sure. But how would extinction grow up as personality? We know he is pretty impressionable, as mention in the prior asks. But since Recall is Recall, which is a more introverted individual with his own problems, and Killer is mostly spending his time in phase 1, because for him phase 2/3 is a liability, meaning he will act mostly as classic sans, but with more depression, self-hatred, emotionally tired, suicidal tendencies [He might not act on it, but considering that after he took Chara's control, he wanted to give Papyrus a happy ending before erasing himself, guy is not healthy mentally], volatile emotions/bipolarity and other options, I don't think Extinction will grow up as gremlin, but he won't be like his canon adult self either."
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
"Like, I think he will inherit some problems/bad habits of those two in some way or form, maybe paranoia, pessimism or more. Though, this begs the questions, what hobbies or positive aspects will he inherit from them, the love for puns, knitting, or some other things?"
"Also, if extinction is impressionable, wouldn't he take values and opinions from them two, since he is a child right now, and children's views are surely based on their own, but they can be influenced from closed people such as family, and since Extinction cares about the two of them, there wouldn't be a grudge to stop him from taking their views into consideration."
"Since it was mentioned the possibility of Recall remembering who he was in the past due to Killer, it could be due to multiple reasons. Maybe Killer is speaking with Extinction about Papyrus, considering Extinction knows about Killer's story, and in true sans fashion, Killer would tell Extinction what a cool guy he is, for his morality, attitude and creativity. Now, since we know canon Error, not Recall, doesn't like hearing about Papyrus, I think this would have a even bigger effect on Recall, hearing those two always talk about Papyrus, or some other version of it. Maybe the guilt in Killer's tone when he is speaking about Papyrus sometimes, flasing some memories about Geno's despair in seeing Papyrus die over and over again. It could be some ideas, it is your story, so I am interested in your idea."
"And finally, for Killer's errorification, wouldn't phase 1 mean that he is mostly calm per say, maybe overprotective to the point of being even more suicidal, if we take the consideration that his last thought was of him being killed in order to protect them from the danger. Would he retain his soul phases, or would he be stuck in phase 1 permanently? And would he remembed who he was if Extinction tells him his story, since Killer told most of it to Extinction."
"What do you think? Also, you don't need to rush in answering, there is time."
lmao this hypthetical scenario went from wholesome to border angst, such potential.
but sad to say, after going thru over the whole idea, i appear to not have much ideas what will come out of this exactly. to an extent, ive realised that i didnt thoroughly fleshed out extinction's story how he coped throughout since his family is dysfunctional. he canonly appeared calm, reserved and indifferent as a young adult, gotta figure out how he resulted to be that lmao but yknow my head is invested with something else that i wont be making much effort thinking it thru, maybe someday. as of the moment i cant think up how he'll be in this hypothetical scenario since i got not much canon data to cross reference for a very likely outcome and also me and bri are lazy
as for killer's errorfication, well i dont understand much of his phases, so im not exactly sure if it will still take effect, let's say nightmare gets a hold of him again as an error. probably it will, probably it wont, idk
and killer's with recall and ex throughout the process so dont think he'll forget 'em. idk what's the extent of the errorfication when it comes to erasing memories but he got company there with him so i supposed he'd lose some but not all.
33 notes · View notes
golangonline · 6 months ago
Text
Go Programming Training | Golang Training In Hyderabad
Advanced Error Handling in Golang: Best Practices and Patterns
One of the fundamental patterns in Golang Training Error handling is the use of custom error types. By creating custom errors, developers can add context to their errors and make troubleshooting more effective. A common approach involves implementing the error interface and adding detailed information that can be used later for logging or debugging. This not only improves the readability of the code but also makes error messages more descriptive. For instance, wrapping errors using the fmt. Errorf function with contextual information is a best practice that helps trace the origin of errors. Such techniques are often covered in a Golang Course Online to ensure learners understand how to handle errors gracefully in production environments. Golang Training In Hyderabad
Tumblr media
Another critical pattern in advanced Golang error handling is error propagation. Rather than handling errors at the point of occurrence, Golang encourages developers to propagate errors up the call stack by returning them to the caller. This ensures that errors are handled at the appropriate level in the application, maintaining clean and maintainable code. In Golang Online Training, developers learn how to use defer statements effectively to manage resources and avoid resource leaks, even when errors occur. Proper error propagation also supports the implementation of retry logic, where transient errors can be retried without affecting the stability of the system.
Logging and monitoring form another key pillar of error handling in Golang. Effective error handling doesn't stop at catching and propagating errors; it also involves logging errors in a structured and meaningful way. Structured logging, often taught in, allows developers to capture critical data points that can help diagnose issues post-deployment. Tools such asand zap are popular choices for structured logging in Golang. These tools provide powerful capabilities to format and route logs to different outputs, ensuring that error logs are easily accessible for analysis. Understanding how to integrate logging libraries into your Golang applications is a crucial part of advanced Golang Online Training.
In addition to logging, implementing centralized error handling mechanisms is essential for large-scale Golang applications. Middleware patterns in web services, for example, allow developers to manage errors in a unified way, reducing the need to handle errors at every endpoint individually. This pattern is often highlighted in a Golang Course Online to demonstrate how middleware can intercept errors and format responses consistently across the application. By adopting this approach, developers can enhance the user experience by providing clear, user-friendly error messages.
Testing and validating error handling routines is another area emphasized in Golang Online Training. Writing tests that simulate error conditions and verify the application’s response is a best practice that improves software reliability. Techniques such as table-driven tests are commonly used to evaluate multiple error scenarios systematically. This not only increases code coverage but also ensures that edge cases are adequately handled. Learning how to incorporate these testing methodologies is an integral part of advanced Golang Course Online
Conclusion
Advanced error handling in Golang is an essential skill for building resilient and maintainable applications. Through the implementation of custom error types, error propagation, structured logging, and centralized error handling, developers can enhance the robustness of their applications. For those looking to deepen their expertise, enrolling in a Golang Course Online or participating in Golang Online Training is highly recommended. These courses cover the intricacies of Golang error handling, ensuring that learners are equipped to tackle complex projects with confidence. Whether you’re a beginner or an experienced developer, mastering error handling through Golang Training can significantly boost your programming capabilities and career prospects.
Visualpath Provides Go Programming Training Hyderabad. Get an Go Programming Training from industry experts and gain hands-on experience with our interactive programs. We Provide to Individuals Globally in the USA, UK, Canada, etc.
For more information
Attend Free Demo
Call On: +91-9989971070  
Visit Blog: https://visualpathblogs.com/
WhatsApp: https://www.whatsapp.com/catalog/919989971070/
Visit: https://www.visualpath.in/online-golang-training.html
0 notes
the-stardom · 2 years ago
Text
Tumblr media
StarDom!Multiverse Star Sanses
OG Dream!Sans by @/jokublog
OG Swap!Sans by [N/A]
OG Ink!Sans by @/comyet & @/myebi
The StarDom!Multiverse is an alternative Multiverse that follows my own view and head-canon of the characters we all know and love.
Tumblr media
He was born 2 minutes before Nightmare, but he plays along on being the younger one because that makes Nightmare happy
Had some suspicions about the abuse the villagers did to Nightmare, but didn't want to jump into conclusion
He himself has been used and abused by the villagers but though it was normal for the guardian of positivity to help
He was 8 when the apple incident happened
It took around 500 years for him to escape the stone prison and developed claustrophobia and PTSD
His first friend was Haventale Sans, although they don't talk as much they used to do nowadays
Biologically speaking he's 500+ years old, but mentally he's only 16 making him hypothetically the youngest of the Stars
Was friends with Ink before an argument, let them apart
He knows that the current Nightmare isn't his brother, but because they share the same body he believes that they are still connected
No one knows, but he's #1 Nightmare fan
Does have a forked tongue due to an "accident"
He has mastered his control over emotions and can release or hold in both positive and negative emotions
[More to be added]
An excellent liar, sometimes he forgets that the thing he said was a lie
He's kind but not a pushover
He also can be mean sometimes when he's stressed
Tumblr media
He was about to transform into an error before Error threw him away from his Anti-Void, and that caused him to become invulnerable to Error and obtain new powers
He can hop around the multiverse, create stars as weapons (similar to Asriel's stars) and he's almost immortal but can still die through violent ways
He was friends with Ink before the errorfication but stopped after Ink told him he was replaceable as there are many versions of him
Dream rescued Blue when he was thrown away
Has a scar on his neck caused by Error
Held a grudge against Error for making him unable to go home but got over it
Because part of him is an error, he has become more impulsive
Is insecure about the black bones on his body, therefore his covers it
Very good at manipulation
Uses his reputation as "cute swap sans" to get what he wants (and it works most of the time)
If angered, he can start glitching, especially on his cape
[More to be added]
Often visit Underswap, where he was, indeed, replaced with another Sans
Doesn't cook as often as none of the Stats needed to eat
Hates being in the Anti-Void, even if he can go out on his own
He still believes that everyone can change if they just try
He will prioritize Swap AUs over others
Tumblr media
He does have emotions, he just need to activate them with paint
Has a pet snake that he stole adopted named Peppy
The snake species is Terciopelo or Bothrops Asper
Forgot Dream and Blue were no longer friend with him and tried to befriend them again
He can and will ignore the laws of physics
Can grant creatures the ability to hop around the Multiverse
He hates being alone, especially in the Anti-Void
After befriended Dream and Blue again, he has written their information on his scarf (He doesn't remember that they were past friends)
He is quite apathetic and can't understand the emotions of other people very well, but that doesn't mean he doesn't care
Surprisingly, he's the therapist of the group!
Often forget Dream and Blue's name and when he does, he calls them buddy, friend or pal
Hates it when it happens because even with his bad memory he knows that they are someone important to him
[More to be added]
No matter how apathetic he can be, he is more than capable to know when someone is using him
Have never tried makeup until Dream and Blue showed him
Calls Error "mou chou"
The star badges on their outfit is a tool created with their magic
Blue's magic created its shape
Dream's magic gave a protection and healing overtime
Ink's magic can make them teleport back to base with only a drop of magic
114 notes · View notes
codingandcrafting · 3 years ago
Text
Learning Go with Testing Ex#1
Writing a test in Go is similar to writing a function. While I don't use tests as often in my day to day, it's important to revisit this skill.
Let's start by writing a function in Go and let's revisit what a function requires. If this was a go file, we would start by stating the package and then import "fmt" or "testing" but for now, we'll just compare the functions.
func Hello() string {
return "Hello World!"
}
func TestHello(t *testing.t) {
got := Hello()
want:= "Hello World!"
if got != want {
t.ErrorF("got %q want %q", got, want)
}
Let's breakdown what makes up a simple Hello() function. The function header includes the word func, the function name which in this case is Hello() and the return type, which in this case is string. The function header is now done and now we can dictate what we want to return. As mentioned earlier, our return type is a string. So we can use the return keyword along with the string we are returning, which is Hello, World in quotes. Boom, we've made our first Hello() function in Go.
Now, let's breakdown what makes up a simple TestHello() function that will test our Hello() function. The function header begins with the word func, the test name which is TestHello, and an argument (t, *testing.T). Now we need to pull in the string returned by the Hello() function and compare it with the correct string, which is "Hello, World!". First, the string returned by Hello() is stored in a variable named got. Second, the correct string is stored in a variable named want. Now, we can compare the two strings using an if statement. We can check to see if the strings do not match, and then return an error statement using the ErrorF method.
Thus, we have created a simple function and test for that function.
The reference that I'm using is: https://quii.gitbook.io/learn-go-with-tests/go-fundamentals/hello-world
1 note · View note
sufficientlylargen · 5 years ago
Photo
It’s really fun the way this breaks a lot of things in small ways… like printing a four-character string causes the last character to be printed twice, and the `import this` easter egg has every ‘f’ replaced with a ‘d’ and every ‘s’ replaced with an ‘f’:
>>> import this The Zen od Python, by Tim Peterf
Beautidul if better than ugly. Explicit if better than implicit. Fimple if better than complex. Complex if better than complicated. Dlat if better than nefted. Fparfe if better than denfe. Readability countf. Fpecial cafef aren’t fpecial enough to break the rulef. Although practicality beatf purity. Errorf fhould never paff filently. Unleff explicitly filenced. In the dace od ambiguity, redufe the temptation to gueff. There fhould be one– and prederably only one –obviouf way to do it. Although that way may not be obviouf at dirft unleff you’re Dutch. Now if better than never. Although never if odten better than *right* now. Id the implementation if hard to explain, it'f a bad idea. Id the implementation if eafy to explain, it may be a good idea. Namefpacef are one honking great idea – let'f do more od thofe!
Also note that you want …[4] instead of …[6] if you’re using python 2, because it lays out the small integer cache differently.
Tumblr media
int five = 3;
446 notes · View notes
mattn · 8 years ago
Text
Re: Go言語感想文
幾らか言いたい事があったので。
Go言語感想文 - なるせにっき
序 最近、敵情視察を兼ねた仕事ととしてGoでアプリケーションを書いていた。このアプリケーションがどんなものかはそのうち id:tagomoris さんがどこかで話すと思うけれど、この コンポーネント ...
http://ift.tt/2rMxoke
GoroutineとChannel
Goroutineはようするにスレッドなんですが、文法と実装の支援でより気軽に使えるのが他の言語との違いでしょうか。なので、Goroutineをどれだけほいほい使うべきかというコスト感覚を身につけることがとても大事な気がします。Rubyなどとは気持ちを切り替えていく必要があるでしょう。ぼくはまだ切り替えきれていません。
Goroutine はスレッドではありません。Goroutine はコルーチンでありスレッドです。ランタイムが必要に応じてスレッドで実行するかコルーチンで実行するかをインテリジェントに切り替えます。ユーザが意識する必要はありません。無秩序に大量に作る様な事がないのであれば気軽に作成して良いはずです。
テストについて
アサーションをコピーしなければならない理由は一つのテストケースの中で異なるテストが混在しているか、単に同様のテストがコピーして作られているのが原因ではないでしょうか。
極端な例かもしれませんが、例えば以下の FizzBuzz 関数をテストするとします。
package fizzbuzz import "fmt" func FizzBuzz(n int) (string, error) {     if n < 1 || n > 100 {         return "", fmt.Errorf("invalid number: %v", n)     }     switch {     case n%15 == 0:         return "FizzBuzz", nil     case n%3 == 0:         return "Fizz", nil     case n%5 == 0:         return "Buzz", nil     default:         return fmt.Sprint(n), nil     } }
1未満や100を超える値の場合はエラーとなり、それ以外は通常通り FizzBuzz の結果を返します。これをのっぺりとテストすると
func TestFizzBuzz(t *testing.T) {     var input int     got, err := FizzBuzz(-1)     if err == nil {         t.Fatalf("should be error for %v but not:", -1)     }     got, err := FizzBuzz(1)     if err != nil {         t.Fatalf("should not be error for %v but:", 1, err)     }     if got != "1" {         t.Fatalf("want %q, but %q:", "1", got)     }     got, err := FizzBuzz(3)     if err != nil {         t.Fatalf("should not be error for %v but:", 1, err)     }     if got != "Fizz" {         t.Fatalf("want %q, but %q:", "Fizz", got)     } }
この様に Fatalf のコピーになりかねません。まだ Buzz や FizzBuzz のテストも出来ていませんから、これからコピペが大量に作られる訳です。確かに Ruby の DSL は強力で、この様な退屈なテストを短い構文で記述する事が出来ます。しかし例外のない Go においては if 文が頻発し得ます。そこで Go ではテーブルドリブンテスト(Table Driven Tests)が推奨されています。
TableDrivenTests · golang/go Wiki · GitHub
Home Articles Blogs Books BoundingResourceUse cgo ChromeOS CodeReview CodeReviewComments CodeTools C...
http://ift.tt/1QNzgNS
以上のテストを Table Driven Tests に置き換えると以下の様になります。
func TestFizzBuzz(t *testing.T) {     tests := []struct {         input int         want  string         err   bool     }{         {input: -100, want: "", err: true},         {input: -1, want: "", err: true},         {input: 0, want: "", err: true},         {input: 1, want: "1", err: false},         {input: 2, want: "2", err: false},         {input: 3, want: "Fizz", err: false},         {input: 4, want: "4", err: false},         {input: 5, want: "Buzz", err: false},         {input: 6, want: "Fizz", err: false},         {input: 14, want: "14", err: false},         {input: 15, want: "FizzBuzz", err: false},         {input: 16, want: "16", err: false},         {input: 100, want: "Buzz", err: false},         {input: 101, want: "", err: true},     }     for _, test := range tests {         got, err := FizzBuzz(test.input)         if !test.err && err != nil {             t.Fatalf("should not be error for %v but:", test.input, err)         }         if test.err && err == nil {             t.Fatalf("should be error for %v but not:", test.input)         }         if got != test.want {             t.Fatalf("want %q, but %q:", test.want, got)         }     } }
このテストでは今後テストケースを増やしても if が増える事はありません。つまり t.Fatal も増えません。一つのテストケースの中でテストされる結果はおおよそ同様の物となるはずです。そうでないならばそれはテストがユニットテストになっていないのだと思います。
その他
switchべんり ← おまえほんとうにそれでいいのか ** selectやswitchの中でbreakすると外側のforまで届かないのでbreak すればよいけど、結局goto使う
Golang に限らずですが、最近の言語では Labeled Break という物があります。
exit_loop:     for {         s := foo()         switch s {         case "exit":             break exit_loop         }     }
Goはnull安全ではない←構造体のポインタを扱い始めると気になってくる
重箱ぽくなりますが、構造体フィールドに直接アクセスしなければレシーバが nil かどうかで判定出来ます。
package main import "fmt" type Foo struct {     v int } func (f *Foo) doSomething() string {     if f == nil {         return "ぬるぽ"     }     return "のっとぬるぽ" } func main() {     var f *Foo     fmt.Println(f.doSomething()) // ぬるぽ     f = new(Foo)     fmt.Println(f.doSomething()) // のっとぬるぽ }
まぁ、f が nil である事も条件を切り分ける為の一つの状態なので、これはあまり使わない手法ではあります。
from Big Sky http://ift.tt/2rNC4Gm
4 notes · View notes
masaa-ma · 8 years ago
Text
Go言語におけるエラーハンドリングを今一度振り返る
from https://developers.eure.jp/tech/golang-error-handling/
こんにちは! エンジニアの臼井です。 この記事は、 eureka Advent Calendar 2017 2日目の記事です。 昨日は、梶原さんの ”モダンな情報システム”を目指しているeurekaが、今年で一番変わったお話をしたい。 という記事でした。
今日の記事では、Go言語のエラーハンドリングについて、標準のerrorインターフェースについて他言語における例外機構と比較しながら考えていきたいと思います。
error インターフェース
はじめに、Go言語には例外が存在せず、関数やメソッドが複数の返り値を返すことが可能であることを利用して、以下の様なイディオムでエラーハンドリングを実行することを示します。
複数の返り値の最後の値を error インターフェースを満たす型で返し、呼び出し元でそのエラーを元に処理を行います。panic-defer-recover を使用したエラーハンドリングは多くの場合推奨されません。 エラーが発生していない場合は nil を返却し、処理が正常終了したことを知らせます。
Go言語には正常系のエラー処理機構はこの error インターフェースを用いたものしか存在しないため、コードのそこかしこにこのイディオムが現れます。 これまでに書いた if err != nil の数は思い出すことは非常に困難です……
他言語における例外機構
さて、他言語における例外機構ですが、C#のメソッドのコード断片をサンプルコードとして利用します。 class や namespace の記述を省略しますが、基本的な構文は以下の様な感じになると思います。
整数の配列を引数にとり、その商を返す単純な関数ですが、わざとゼロ除算や配列インデックス外の参照が発生する可能性を持たせ、例外のメッセージを標準出力に出力した後 rethrow しています。 呼び出し元では発生したエラーのタイプによって例外の型が異なるため、それに応じたエラー処理が可能です。
error インターフェースと例外機構の比較
さて、ここでGo言語のエラー構文に戻ります。 error インターフェースを��たす型が返ってきて、その有無でハンドリングしているだけに見えます。 ここで、error インターフェースの実装を確認してみましょう。
https://github.com/golang/go/blob/ce68e1b81c470ef29ece6a33980ab05e2b8bb30c/src/builtin/builtin.go#L255-L257
type error interface { Error() string }
エラー文字列を返す Error() メソッドだけ実装されていればよいというシンプルなものです。 標準の errors パッケージにはデフォルトのエラー型を生成する関数が存在します。 実体を見ると、エラー文字列のフィールドだけを持つ構造体で、New 関数にてエラー文字列がセットされた構造体それを生成しそのポインタが得られます。 エラーを生成するときによく用いる fmt パッケージの Errorf() 関数は、この関数のラッパーです。 https://github.com/golang/go/blob/master/src/errors/errors.go#L1-L20
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package errors implements functions to manipulate errors. package errors // New returns an error that formats as the given text. func New(text string) error { return &errorString{text} } // errorString is a trivial implementation of error. type errorString struct { s string } func (e *errorString) Error() string { return e.s }
なんらかのエラーが発生した場合、標準の error インターフェースとして扱う場合は Error() メソッドによるエラー文字列の取得のみが可能となっています。 つまり他言語の例外機構のように、try-catch-finally��による制御や、例外クラスが提供する豊富なプロパティとメソッドによるエラーに関する情報の取得や通知は、そのままで行うことは難しくなっています。
標準パッケージにおけるエラー処理の例
net パッケージはネットワークレイヤ(TCP/IP,DNS, Unixドメインソケット)に関する機能を提供する標準パッケージで、他言語のようにエラーの種類によりいくつかのエラー型が存在します。これらを以下に示します。
AddrError
DNSConfigError
DNSError
InvalidAddrError
OpError
ParseError
UnknownNetworkError
これらの型は net パッケージ内で宣言される以下の net.Error インターフェースを満たします。
type Error interface { error Timeout() bool // Is the error a timeout? Temporary() bool // Is the error temporary? }
基底の例外クラス
上記を継承した名前空間・パッケージ単位での例外クラス、あるいはその言語におけるインターフェース
具体的なエラーを表すさらに上記を継承した例外クラス
に相当するオブジェクトがGo言語の標準パッケージにも存在するということです。 ここで、 DNSError が使われている箇所について具体的に見てみます。 https://github.com/golang/go/blob/master/src/net/dnsclient.go#L12-L18
// reverseaddr returns the in-addr.arpa. or ip6.arpa. hostname of the IP // address addr suitable for rDNS (PTR) record lookup or an error if it fails // to parse the IP address. func reverseaddr(addr string) (arpa string, err error) { ip := ParseIP(addr) if ip == nil { return "", &DNSError{Err: "unrecognized address", Name: addr} } }
IPアドレスからのDNS逆引き検索処理の関数で、引数で与えられるIPアドレスが想定外であれば、DNSError 型にエラーメッセージと引数でそれぞれ対応するフィールドを初期化し、 error として返します。 呼び出し元が処理の失敗時の詳細についてどこまで知りたいかによりますが、失敗の検知とログ出力で十分ならば、 error をそのまま利用するのみで問題ありません。 厳格にDNS関連の処理のエラーであるとして処理を続行したいならば、以下の様に型アサーションを行い DNSError 型であるという情報を用いて例外処理のcatch句のような処理も可能でしょう。
エラー処理の実際
現実のGo言語のアプリケーションコードにおいて、常に具象の error 型を定義するかというとそういうことはなく、エラー発生時のエラー文字列とエラーコードをフィールドに持つ汎用的な型を使用することで事足りることもあります。 しかし、ミドルウェアやAWSなどの外部インフラ・APIへのアクセス、アプリケーション層内の処理のみで純粋に完結しないエラーがある場合に少し問題があります。 具体的には、以下の様に、
外部APIが5xxエラー (インフラ層)
APIからデータ取得失敗しているのでその後のDB更新ができない(ドメイン層)
……
と、インフラ層で外部APIアクセスに関するエラーが発生した場合を考えます。 このエラー内容を上位層に伝播させていく場合に、error を適切なフォーマットで文字列連結して新しい error を生成して伝えるなど、そのままではエラーに関する情報の伝達が煩雑になります。 また、最初に述べたように Go言語の基本の error 型は文字列のフィールドのみを持つシンプルな構造であり、スタックトレースが保持できないため、デバッグが困難になることがあります。 この問題の解決の為に、pkg/errors パッケージを利用します。 golang.org/pkg/ (ドキュメント) https://github.com/pkg/errors (リポジトリ) はGo言語のメインリポジトリとは独立していますが、公式により提供されている標準に近いライブラリ群です。
pkg/errors
単純にスタックトレースと各々の層でのエラーメッセージを保持するだけのケースであれば、以下の様にパッケージ関数を用います。
エラーが初めて発生した時、pkg/errors.New または Errorf 関数で新規エラー作成して返す。
上層でのエラーメッセージ付与は、下層のエラーを pkg/errors.Wrap や Wrapf 関数で追加して返す。
ログ出力等でスタックトレースを表示する場合、 pkg/errors.Cause 関数で発生元のエラーとスタックトレースを抽出し、出力する。
得られたエラーに対して %+v 書式を指定すると、以下の様にメッセージとスタックトレースが得られます。 このスタックトレースは、pkg/errors 内で runtime.Caller 関数を利用して得たものが使われます。
ErrorMessage Package1.FuncName1 /path/to/file1.go:LineNo1 Package2.FuncName2 /path/to/file2.go:LineNo2 ...
得られたエラーをそのまま出力すると、各層で Wrap されたエラーがそのまま全て出力されてしまうので、スタックトレースと直近のエラーメッセージのみで十分ならば pkg/errors.Cause 関数で取り出したエラーのみを利用するとよいでしょう。
pkg/errors と例外機構
Go言語のエラーハンドリングについて、標準に近い方法で例外機構のようなエラーハンドリングを行うための手段についてコードを見ながら考えました。 pkg/errors を利用してスタックトレースを得て、エラーの内容に応じたエラー型を用いることで、ある程度類似のことは出来ることがわかります。 ただ、元々のエラーハンドリングがシンプルであったがゆえに、これらを正しく遂行しようとすると、記述量もどんどん増えていくことが予想されます。 if err != nil {return err} に加えて、switch (err) {case err.(SomeError):...} という処理がエラー型の数と実行箇所の分あらわれてきます。 Go言語はそのシンプルな言語仕様が一つの大きな魅力であり利点ですが、通常の例外機構レベルのリッチなエラーハンドリングを常に実現しようとすると、アプリケーションコードがエラーハンドリングで埋め尽くされてしまうのではないでしょうか。 これに対して取るべき道はいくつもあると考えられます。
標準 error 型のみで常にシンプルに処理する。
pkg/errors の使用と各種エラー型の定義を必ず行い、例外機構にできるだけ近い厳格な処理を行う。
pkg/errors の使用と各種エラー型定義を行うが、部分的なものとする。
標準 error 型のみで処理した場合運用が困難になるアプリケーションをGo言語で記述しない。
etc…
現実的には、3つめの部分的な pkg/errors と 各種エラー型の導入であると思いますが、Go言語らしさを考えると4つめの選択肢もまたひとつあり得るのではないかと考えます。 Go言語らしさとは、というところに議論があると思いますが、標準から大きく外れた使い方をすると生産性の低下や困難が発生しやすく、良くも悪くもこれであるのかなと考えています。 基本的にオブジェクト指向設計と実装が可能なGo言語ですが、標準の機構が極めてシンプルなため、このような議論が発生し得ます。 あえてシンプルにすることで、適するユースケースを浮き彫りにしているのかもしれません。
おわりに
Go言語におけるエラーハンドリングについて、例外機構と比較しつつ pkg/errors と具象のエラー型を用いたエラーハンドリングについて概観し、どこまでこれを適用すべきかということについて書きました。 Go言語もエウレカがPairsのサーバサイドフルスクラッチ導入の時期と比べると、利用者も導入組織も大きく増えていると感じます。 利用者が増えるほどユースケースも増え、開発ツールとしてのプログラミング言語に求められることも変わってくるのではないかなと考えています。
明日はBIチーム大久保さんの、 分析クエリを「速く・楽に・正確に」書くためにスニペットに登録すべきもの5選 です。お楽しみに!
参考資料
プログラミング言語Go 第7章
https://blog.golang.org/error-handling-and-go
エウレカでは、一緒に働いていただける方を絶賛募集中です。募集中の職種はこちらからご確認ください!皆様のエントリーをお待ちしております!
0 notes
a-v-j · 2 years ago
Note
"Part 3:"
"However, despite his self-hatred slowing his soul reversing to stage 1, Killer!Sans wants to become Classic Sans, he wants his old life back, he hates what he was forced to become for Chara/Player's entertainment. This is proven because there are multiple endings for Killer Sans, one where he kills Chara, takes their ability to reset, gives Papyrus a happy ending, from where it could be split into him getting captured by Nightmare or something else. Killer ain't the biggest fan of Nightmare or the human."
"Source: https://rahafwabas.tumblr.com/post/160104814080/killer-me-color-superyoumna-nightmare"
"Source: https://rahafwabas.tumblr.com/post/148197255630/doodle-comic-wowwwwwwtf-xd-people-asking-to?is_related_post"
"Source: https://rahafwabas.tumblr.com/post/153462836880/something-new-chapter-1-time-line-part-1"
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
"And this is not related to the souls, but this guy also suffers from hallucination as well, mostly Chara, Frisk or his other extreme personality."
"Source: https://rahafwabas.tumblr.com/post/163493536850/bad-english-stage-4-killer-me-color"
"Source: https://rahofy-sketch.tumblr.com/post/190629677728/a-good-person-sorry-bad-english"
Tumblr media Tumblr media
"So, in conclusion, Killer!Sans's soul is in state between one of a monster and one of a human/player, giving him the ability to save/load/reset, due to his high determination from where the black goop from his eye sockets come from. The stage of his soul is dependent on his emotions, and any outside interference. So most likely, Killer's errorification would be mostly done in stage 1. What do you think?"
Lmao, i don't exactly have the enough amount to motivation to actually explore killer's errorfication in relation to the hypothetical scenario with recall and ex
But i find this useful in developing Nate(assasinate aka anti_error!killer)
Ofc i have to bend it a little 'cause phase 1 is a sad and nate is a skrunkly not sad boi, crossiant is the one for that as i planned
But these are useful info nonetheless
35 notes · View notes
a-v-j · 2 years ago
Note
"But by the same logic, isn't Geno!Sans also a Classic Sans, since he is a wounded classic near death in a space where time doesn't work? So shouldn't he also turn into anti instead of error if we go by the logic that any variant of classic turns into anti? Disclaimer, I am not interested in the any error design or story, but more in the inner workings of the Anti-Void."
"Since Killer and Dust turning into Anti because they were classic, and Geno not turning into anti despite being a classic variant himself seem contradictory, since all of them were classic. And Anti!Dust's story mentioned the player threw him in Anti's Anti Void, not Errors. So as a concept, if they threw him in any of the Error's void (Recall, Redacted, Hobo), would something else happened? Since due to this logic, all error version of underswap sans should have turned into blueberror or something identical."
"In the end, it seems that the only logical conclusion which would allow of all this to happen was that each Anti-Void has different errorifying properties , or circumstances were also a factor, but that would contradict with the Anti_Error gang's circumstances."
Welp cant change how avjverse's anti-void work
I mean i have to bend some canon of killer's and dust's stories just to ensure their errorfication will result to an Anti_error
But i can say that if they didnt go pacifist before errofying, then they'll probably turn to their own error versions.
Also geno may come from a classic but his errorfication already resulted as error so we go by that rule
15 notes · View notes
a-v-j · 2 years ago
Note
How long did it take for Paperror (BluError’s Papyrus I believe) to become insane and errorify? How long did it take before he started contemplating kidnapping? 😳
Im p'sure quite a long while, the same length it took for error to become one. I think he started thinking of the kidnapping just after his errorfication since finding his brother is his last thought, he's gone desperate enough to do what it takes to accomplish that
18 notes · View notes
a-v-j · 2 years ago
Note
"Back with another question for the wholesome scenario, since I am still confused. While your Killer is gremlin during his phase 3 soul in, wouldn't he revert to phase 1 without Nightmare's interference, meaning he would not be a gremlin most of the time, but a depressed Sans who wishes to be killed if he goes too insane again. So while I can see that Extinction might mimic the gremlin part of Killer, what about the depressed classic sans of phase 1 killer? Since I think that would affect Extinction's childhood quite a lot, knowing the circumstances of Killer's soul."
"Also, since Killer had experience with Nightmare, The Multiverse and so on, would he teach Extinction about AUs, Human's Anatomy, Human's Soul, Monster's Soul, Resets, Time Manipulation, Save Screen, etc,along with Recall if he will teach Extinction as well, so if something happens to Killer and Recall, Extinction knows how to traverse the multiverse on his own and not be manipulated like Killer was."
"Compared to Canon Aged Extinction, I think Extinction here would grow more pessimistic or paranoid a bit, considering Killer and Recall are two traumatized young adult skeletons, having their PTSDs, Killer with his erratic soul nature, violence and manipulative tendencies in phase 2/3 and Error with his phobias, hateful behaviour towards the multiverse and volative emotions as well. Since you said Extinction is easily impressionable, and Recall doesn't remember being Geno at all or much later, I think he would take his views on the multiverse from Recall and Killer, which would be hateful view from Recall due to how he became Recall or a pessimistic/paranoid view from Killer due to his experiences with beings like Chara, Nightmare, etc."
"Would it depend in what phase of his soul Killer gets errorified? What would his last thought in each phase be which will morph his errorified self?"
Tbh, i forgot about killer's phases and i havent explored much of his 1st phase. I overlook it so much lmao, even tho i had it researched when i was making Nate's character concept lol.
Tbh, extinction at a young age lacks empathy but not curiosity, seeing a depressed killer would be a bizarre thing for him to witness, not when his first impression of killer was this hyper chaotic gremlin. Damn that'll be a potential for angst...
I just thought something now, with all that depressive classic sansiness, it might trigger a hidden memory for error thus unlocking the geno memory or something.
Idk that seems like something they have in common where it can be a potential factor for a non romantic relationship to develop.
And not ngl, killer teaching ex everything he knows is totes adorbs. Ex wouldn't be too fucked up about it, lil guys has a morbid fascination for death so whatever dark natured side of the multiverse killer will disclose will be another marvel story for ex. But with all the resets and junk, that's another thing, that be a bit of a heavy topic for someone so young to understand. Heavy depressing reality altering topic. Brrr. Cant fathom how extinction will handle that.
Idk but it feels like ex relation and interaction to recall and killer wouldn't influenced much of who he is, he got his own thing going on and how he takes certain situations
And as for killers errorfication? I believe it's at the time of his phase 1, so pretty much an error who wishes to die before he goes insane which he will be when he errorfy
Lol
I haven't slept yet and i just got off from work lmao yolo
17 notes · View notes
a-v-j · 3 years ago
Text
Concepts for anti!dust origin
Tumblr media Tumblr media Tumblr media
But then it's a requirement that to result the errorfication to become an ANTI_ERROR, he must be from a pacifist timeline first so
Tumblr media Tumblr media
Concept art for anti!dust and anti!phantom
Tumblr media Tumblr media
Undertale © Toby Fox
Dusttale © ask-dusttale
Dust_anti(Dusty or something like that, still subject for change) and phantom_tip(Tom or Tim lol i got lazy but yet again subject for change)© yours truly
Commission temporarily close but here's link incase i reopen
118 notes · View notes
a-v-j · 2 years ago
Note
Wait do anti_error papyrus know his a anti? Do he know how to use the power his been given? There's so much ask I need to ask like what happened to the lother papyrus did they turn out like him or differently I'm so confused
Lol nah. Anti!swappy isnt aware right now he's an anti_error. His type of errorfication is only tempo lol. And for powers, i don't know that yet
10 notes · View notes