Skip to content

Commit 0f80be7

Browse files
committed
Added sponsor link
1 parent ae71268 commit 0f80be7

File tree

6 files changed

+17172
-17051
lines changed

6 files changed

+17172
-17051
lines changed

src/exceptionite/assets/App.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
<!-- page content -->
2323
<div class="container mx-auto py-4 lg:p-4">
24+
<sponsor />
2425
<div ref="exceptioniteBlock">
2526
<exception :exception="exception" />
2627
</div>
@@ -72,6 +73,7 @@
7273
import { ref, computed, provide } from 'vue'
7374
import { useElementVisibility, useStorage } from '@vueuse/core'
7475
import Navbar from "@/components/Navbar.vue"
76+
import Sponsor from "@/components/Sponsor.vue"
7577
import Exception from '@/components/Exception.vue'
7678
import Stack from '@/components/Stack.vue'
7779
import ContextMenu from '@/components/ContextMenu.vue'
@@ -84,6 +86,7 @@ export default {
8486
components: {
8587
Exception,
8688
Stack,
89+
Sponsor,
8790
ContextMenu,
8891
Navbar,
8992
ShareDialog,
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div class="bg-white dark:bg-gray-800 rounded-md p-2 w-full text-black mb-4 shadow-md">
3+
<span style="text-decoration: underline">
4+
<a target="_blank" href="https://github.com/sponsors/MasoniteFramework">❤️ Find this page useful? Support Masonite so we can continue to build great free tools like this one!</a>
5+
</span>
6+
</div>
7+
</template>

src/exceptionite/assets/components/Stack.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
v-tooltip="`Show/Hide vendor frames in stack trace`"
1111
>
1212
<SolidSelectorIcon class="-ml-0.5 mr-2 h-4 w-4" />
13-
{{ showVendors ? "Hide" : "Show" }} Vendor ({{ vendorsFrameCount }})
13+
{{ showVendors ? "Hide" : "Show" }} Vendor Stacks ({{ vendorsFrameCount }})
1414
</button>
1515
<button
1616
@click="copyStack"
@@ -132,7 +132,7 @@ export default {
132132
toggleVendor() {
133133
// if we were showing vendors frame and current is vendor
134134
// set current as first non vendor
135-
if (this.showVendors && this.currentFrame.is_vendor) {
135+
if (this.showVendors && this.currentFrame?.is_vendor) {
136136
this.currentFrame = this.stack.filter(frame => !frame.is_vendor)[0]
137137
}
138138

src/exceptionite/blocks/PossibleSolutions.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ def __init__(self, tab, handler, options):
2020
self.register(
2121
solutions.DictionaryUpdateSequence(),
2222
solutions.ClassMethodExists(),
23+
solutions.ClassModelMethodExists(),
24+
solutions.QueryDefaultValue(),
2325
solutions.GetAttributeObject(),
2426
solutions.NoModuleNamed(),
2527
solutions.Syntax(),
@@ -35,13 +37,16 @@ def build(self):
3537
possible_solutions = []
3638
for solution in self.registered_solutions:
3739
r = re.compile(solution.regex())
40+
print(r)
3841
if r.match(self.handler.message()):
3942
description = solution.description()
43+
title = solution.title()
4044
matches = [m.groupdict() for m in r.finditer(self.handler.message())]
4145
for code, replacement in matches[0].items():
4246
description = description.replace(":" + code, replacement)
47+
title = title.replace(":" + code, replacement)
4348

44-
possible_solutions.append({"title": solution.title(), "description": description})
49+
possible_solutions.append({"title": title, "description": description})
4550

4651
return {
4752
"first": possible_solutions[0] if len(possible_solutions) > 0 else None,

src/exceptionite/solutions.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,31 @@ def description(self):
2323
)
2424

2525
def regex(self):
26-
return r"^class \'(?P<class>([\w]*))\' has no attribute (?P<method>(\w+))"
26+
return r"^class \'(?P<class>([\w]*))\' has no attribute (?P<method>(\w+))"
27+
class ClassModelMethodExists:
28+
def title(self):
29+
return "Model method does not exist"
30+
31+
def description(self):
32+
return (
33+
"Could not find the ':method' method on the model class. Please check spelling. If this is a method you expect to be on the builder class then check the ORM documentation"
34+
)
35+
36+
def regex(self):
37+
return r"^class model \'(?P<class>([\w]*))\' has no attribute (?P<method>(\w+))"
38+
39+
class QueryDefaultValue:
40+
def title(self):
41+
return "Missing default value for ':field'"
42+
43+
def description(self):
44+
return (
45+
"Default values are typically set on the database level. "
46+
"You can either add a default value on the :field table column in a migration or you should pass a value when creating this record"
47+
)
48+
49+
def regex(self):
50+
return r"\(1364\, \"Field \'(?P<field>([\w]*))\' doesn't have a default value\"\)"
2751

2852

2953
class GetAttributeObject:

0 commit comments

Comments
 (0)