The server for Open Course World

add logging to course tag update errors

jneen e4901893 6adedf5b

+8 -1
+8 -1
nex/datastore/datastore_smm2_server.go
··· 6 6 "bytes" 7 7 "fmt" 8 8 "smm2_gameserver/nex/rmc" 9 + "log" 9 10 ) 10 11 11 12 type DataStoreServerSMM2 struct { ··· 1912 1913 func (s *DataStoreServerSMM2) HandleUpdateCourseTag(r *bytes.Reader, w *bytes.Buffer) error { 1913 1914 var param UpdateCourseTagParam 1914 1915 if err := Decode(r, &param); err != nil { 1916 + log.Printf("Failed to parse course tag param: %w", err) 1915 1917 return err 1916 1918 } 1917 1919 ··· 1919 1921 return fmt.Errorf("Function not attached: func (s *YourServer) UpdateCourseTag(param datastore.UpdateCourseTagParam) (error) { return err }") 1920 1922 } 1921 1923 // Typedef: func(param datastore.UpdateCourseTagParam) (error) { return err } 1922 - return s.UpdateCourseTag(param) 1924 + if err := s.UpdateCourseTag(param); err != nil { 1925 + log.Printf("Failed to update course tag: %w", err) 1926 + return err 1927 + } 1928 + 1929 + return nil 1923 1930 } 1924 1931 1925 1932 func (s *DataStoreServerSMM2) HandleGetCourses(r *bytes.Reader, w *bytes.Buffer) error {