-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.4.117 recovery deferred location: PanicToErr RecoverErr RecoverDA2…
… RecoverDA, pmaps use B-Tree: OrderedMap OrderedMapFunc KeyOrderedMap ThreadSafeOrderedMapFunc, pqs, Go GoGroup uses Awaitable, refactor: ClosableChan g0.goContext Go.WaitCh Go.EntityID parl.GoEntityID sets.Elements iters-iterators CyclicAwaitable
- Loading branch information
1 parent
0db3e88
commit ae0f641
Showing
126 changed files
with
3,866 additions
and
2,648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
© 2020–present Harald Rudell <[email protected]> (https://haraldrudell.github.io/haraldrudell/) | ||
ISC License | ||
*/ | ||
|
||
package parl | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/haraldrudell/parl/pruntime" | ||
) | ||
|
||
const ( | ||
// counts the stack-frame of [parl.Annotation] | ||
parlAnnotationFrames = 1 | ||
// counts the stack-frame of [parl.getAnnotation] | ||
getAnnotationFrames = 1 | ||
) | ||
|
||
// Annotation provides a default reovered-panic code annotation | ||
// - “Recover from panic in mypackage.MyFunc” | ||
// - [base package].[function]: "mypackage.MyFunc" | ||
func Annotation() (a string) { | ||
return getAnnotation(parlAnnotationFrames) | ||
} | ||
|
||
// getAnnotation provides a default reovered-panic code getAnnotation | ||
// - frames = 0 means immediate caller of getAnnotation | ||
// - “Recover from panic in mypackage.MyFunc” | ||
// - [base package].[function]: "mypackage.MyFunc" | ||
func getAnnotation(frames int) (a string) { | ||
if frames < 0 { | ||
frames = 0 | ||
} | ||
return fmt.Sprintf("Recover from panic in %s:", | ||
pruntime.NewCodeLocation(frames+getAnnotationFrames).PackFunc(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.