File tree Expand file tree Collapse file tree 6 files changed +8
-10
lines changed Expand file tree Collapse file tree 6 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class CodestralService extends ModelService {
18
18
attempt = 1
19
19
) : Promise < CommitMessage > {
20
20
try {
21
- const apiKey : string = ConfigService . getApiKey ( "Codestral" ) ;
21
+ const apiKey : string = await ConfigService . getApiKey ( "Codestral" ) ;
22
22
23
23
const { ok : model , error : modelError } = await ConfigService . get (
24
24
"codestral" ,
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ const ConfigService = {
129
129
message : `Enter your ${ service } API Key:` ,
130
130
label : "API Key" ,
131
131
prefix : "" ,
132
- minLength : 32
132
+ minLength : 32 ,
133
133
} ) ;
134
134
135
135
const { error : validationErr } = KeyValidationService . baseValidation ( key ) ;
Original file line number Diff line number Diff line change 1
1
import axios , { type AxiosError } from "axios" ;
2
2
import { errorMessages } from "../lib/constants.ts" ;
3
3
import type { CommitMessage } from "../lib/index.d.ts" ;
4
- import { logError } from "../lib/Logger.ts" ;
5
4
import { ConfigurationError } from "../models/errors.ts" ;
6
5
import ConfigService from "./configService.ts" ;
7
6
import { ModelService } from "./modelService.ts" ;
@@ -22,7 +21,7 @@ class GeminiService extends ModelService {
22
21
attempt = 1
23
22
) : Promise < CommitMessage > {
24
23
try {
25
- const apiKey : string = ConfigService . getApiKey ( "Gemini" ) ;
24
+ const apiKey : string = await ConfigService . getApiKey ( "Gemini" ) ;
26
25
27
26
const { ok : model , error : modelError } = await ConfigService . get (
28
27
"gemini" ,
@@ -58,7 +57,6 @@ class GeminiService extends ModelService {
58
57
const message = GeminiService . extractCommitMessage ( response . data ) ;
59
58
return { message, model } ;
60
59
} catch ( error ) {
61
- logError ( error ) ;
62
60
const axiosError = error as AxiosError ;
63
61
if ( axiosError . response ) {
64
62
const { status } = axiosError . response ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ const GitBlameAnalyzer = {
32
32
const blameOutput = this . executeGitBlame ( filePath ) ;
33
33
return this . parseBlameOutput ( blameOutput ) ;
34
34
} catch ( error ) {
35
- void logError ( "Error getting blame info:" , error as Error ) ;
35
+ void logError ( "Error getting blame info:" , ( error as Error ) . message ) ;
36
36
throw error ;
37
37
}
38
38
} ,
@@ -118,7 +118,7 @@ const GitBlameAnalyzer = {
118
118
) ;
119
119
return GitBlameAnalyzer . formatAnalysis ( authorChanges ) ;
120
120
} catch ( error ) {
121
- void logError ( "Error analyzing changes:" , error as Error ) ;
121
+ void logError ( "Error analyzing changes:" , ( error as Error ) . message ) ;
122
122
throw error ;
123
123
}
124
124
} ,
@@ -198,7 +198,7 @@ const GitBlameAnalyzer = {
198
198
const blameOutput = GitBlameAnalyzer . executeGitBlame ( filePath ) ;
199
199
return GitBlameAnalyzer . parseBlameOutput ( blameOutput ) ;
200
200
} catch ( error ) {
201
- void logError ( "Error getting blame info:" , error as Error ) ;
201
+ void logError ( "Error getting blame info:" , ( error as Error ) . message ) ;
202
202
throw error ;
203
203
}
204
204
} ,
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ class GitService {
31
31
static initialize ( ) : string | undefined {
32
32
const { ok : output , error } = this . getRepoPath ( ) ;
33
33
34
- if ( error !== undefined ) logError ( error ) ;
34
+ if ( error !== undefined ) logError ( error . message ) ;
35
35
else {
36
36
this . setRepoPath ( output ) ;
37
37
return output ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ class OpenAIService extends ModelService {
30
30
attempt = 1
31
31
) : Promise < CommitMessage > {
32
32
try {
33
- const apiKey : string = ConfigService . getApiKey ( "OpenAI" ) ;
33
+ const apiKey : string = await ConfigService . getApiKey ( "OpenAI" ) ;
34
34
35
35
const { ok : model , error : modelError } = await ConfigService . get (
36
36
"openai" ,
You can’t perform that action at this time.
0 commit comments