Skip to content

Commit

Permalink
Log error message for the Clockify client
Browse files Browse the repository at this point in the history
  • Loading branch information
eXpl0it3r committed Aug 26, 2023
1 parent 4f5f0d2 commit 93f5716
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ jobs:
- name: Install Dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
run: dotnet build --configuration Debug --no-restore
- name: Publish
run: dotnet publish --runtime ${{ matrix.platform.rid }} --self-contained --configuration Release -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IncludeNativeLibrariesForSelfExtract=true
run: dotnet publish --runtime ${{ matrix.platform.rid }} --self-contained --configuration Debug -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=true -p:IncludeNativeLibrariesForSelfExtract=true
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
Expand Down
11 changes: 7 additions & 4 deletions Clockify/ClockifyContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public async Task ToggleTimerAsync()
var workspaces = await _clockifyClient.GetWorkspacesAsync();
if (!workspaces.IsSuccessful || workspaces.Data is null)
{
_logger.LogWarn("Unable to retrieve available workspaces");
_logger.LogWarn($"Unable to retrieve available workspaces: {workspaces.ErrorMessage}");
_logger.LogWarn($"{_apiKey} / {_apiKey} / {_clientName} / {_projectName} / {_serverUrl} / {_taskName} / {_timerName} / {_workspaceName} / {_currentUser?.Id}");
return;
}

Expand Down Expand Up @@ -105,7 +106,8 @@ public async Task<TimeEntryDtoImpl> GetRunningTimerAsync()
var workspaces = await _clockifyClient.GetWorkspacesAsync();
if (!workspaces.IsSuccessful || workspaces.Data is null)
{
_logger.LogWarn("Unable to retrieve available workspaces");
_logger.LogWarn($"Unable to retrieve available workspaces: {workspaces.ErrorMessage}");
_logger.LogWarn($"{_apiKey} / {_apiKey} / {_clientName} / {_projectName} / {_serverUrl} / {_taskName} / {_timerName} / {_workspaceName} / {_currentUser?.Id}");
return null;
}

Expand Down Expand Up @@ -184,7 +186,8 @@ private async Task StopRunningTimerAsync()
var workspaces = await _clockifyClient.GetWorkspacesAsync();
if (!workspaces.IsSuccessful || workspaces.Data is null)
{
_logger.LogWarn("Unable to retrieve available workspaces");
_logger.LogWarn($"Unable to retrieve available workspaces: {workspaces.ErrorMessage}");
_logger.LogWarn($"{_apiKey} / {_apiKey} / {_clientName} / {_projectName} / {_serverUrl} / {_taskName} / {_timerName} / {_workspaceName} / {_currentUser?.Id}");
return;
}

Expand Down Expand Up @@ -214,7 +217,7 @@ private async Task<ProjectDtoImpl> FindMatchingProjectAsync(string workspaceId)
var projects = await _clockifyClient.FindAllProjectsOnWorkspaceAsync(workspaceId, false, _projectName, pageSize: 5000);
if (!projects.IsSuccessful || projects.Data is null)
{
_logger.LogWarn($"Unable to retrieve project {_projectName} on workspace {_workspaceName}");
_logger.LogWarn($"Unable to retrieve project {_projectName} on workspace {_workspaceName}: {projects.ErrorMessage}");
return null;
}

Expand Down

0 comments on commit 93f5716

Please sign in to comment.