This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
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.
Merge pull request #195 from ferreira-tb/create-error-log
feat: permite exportar o registro de erros
- Loading branch information
Showing
32 changed files
with
273 additions
and
165 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import { app } from 'electron'; | ||
import { storeToRefs, watch } from 'mechanus'; | ||
import { useAresStore } from '$electron/interface'; | ||
|
||
/** Define as variáveis de ambiente. */ | ||
export function setEnv() { | ||
process.env.ARES_MODE = 'dev'; | ||
process.env.ARES_VERSION = app.getVersion(); | ||
process.env.CHROME_VERSION = process.versions.chrome; | ||
process.env.ELECTRON_VERSION = process.versions.electron; | ||
process.env.USER_DATA_PATH = app.getPath('userData'); | ||
|
||
const aresStore = useAresStore(); | ||
const { locale, majorVersion } = storeToRefs(aresStore); | ||
|
||
watch(locale, (value) => (process.env.TRIBAL_WARS_LOCALE = value ?? 'unknown')); | ||
watch(majorVersion, (value) => (process.env.TRIBAL_WARS_VERSION = value ?? 'unknown')); | ||
}; |
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
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 |
---|---|---|
@@ -1,8 +1,24 @@ | ||
import type { AllErrorLogTypes } from '$types/error'; | ||
|
||
export class AresError extends Error { | ||
declare public static catch: (err: unknown) => Promise<void>; | ||
|
||
constructor(message: string) { | ||
super(message); | ||
this.name = 'AresError'; | ||
}; | ||
|
||
public static generateLogContent(err: AllErrorLogTypes | AllErrorLogTypes[]) { | ||
const errors = Array.isArray(err) ? err : [err]; | ||
|
||
let content = ''; | ||
for (const error of errors) { | ||
const date = new Date(error.time).toLocaleString('pt-br'); | ||
content += `${date}\nAres: ${error.ares} Electron: ${error.electron} Chrome: ${error.chrome}\n`; | ||
content += `Tribal Wars: ${error.tribal ?? 'unknown'} Locale: ${error.locale ?? 'unknown'}\n`; | ||
content += `${error.stack ?? error.message}\n\n`; | ||
}; | ||
|
||
return content; | ||
}; | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,8 +120,4 @@ const blindAttackOptions = [ | |
</NGridItem> | ||
</NGrid> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
</style> | ||
</template> |
Oops, something went wrong.